网页 综合 更新时间 2026-11-13 17:18:20

Installation | pnpm

自动蜘蛛 pnpm.io 正文约 2806 字
Installation | pnpm
pnpm 12 is a native executable and does not require Node.js after it is installed. The pnpm npm package installs on Node.js 18 or newer. The npx get-pnpm installer requires Node.js 22.13 or newer.
pnpm 12 is the current release line. The latest tag on npm points at it, so the commands below install pnpm 12 without naming a version.
pnpm 12 ships a prebuilt binary for each of these targets:
FreeBSD, ppc64le, s390x, RISC-V, and Android were added in v12.4.0. The NetBSD binary is built and tested on NetBSD 10. On a target with no binary, install the JavaScript pnpm 11 instead.
For StackBlitz WebContainers, see the experimental WebAssembly distribution.
If you already have pnpm v11.10.0 or newer, update directly to pnpm 12:
Inside a project that pins pnpm through the packageManager field, self-update only updates that pin instead of installing pnpm globally.
You may install pnpm even if you don't have Node.js installed, using the following scripts.
Sometimes, Windows Defender may block our executable if you install pnpm this way.
Due to this issue, we currently recommend installing pnpm using npm on Windows.
On Windows, Microsoft Defender can slow down installation of packages. You can add pnpm to Microsoft Defender's list of excluded folders in a PowerShell window with administrator rights by executing:
If you don't have curl installed, you would like to use wget:
You may use the pnpm runtime command then to install Node.js.
Before running the install script, you may optionally set an env variable PNPM_VERSION to install a specific version of pnpm:
Node.js 22.13 or newer is needed to run this installer, but not to run pnpm afterwards.
You can also install the pnpm package globally with npm, which needs Node.js 18 or newer:
Do you wanna use pnpm on CI servers? See: Continuous Integration.
Here is a list of the supported pnpm versions with respective Node.js version support.
pnpm 12 only needs Node.js when it is installed from npm; the version installed by the standalone script runs without Node.js.
If pnpm is broken and you cannot fix it by reinstalling, you might need to remove it manually from the PATH.
For example, a leftover install of an older, JavaScript-based pnpm earlier on PATH can shadow pnpm 12 and fail like this when running pnpm install:
First, try to find the location of pnpm by running: which pnpm. If you're on Windows, run where.exe pnpm.*. You'll get the location of the pnpm command, for instance:
Now that you know where the pnpm CLI is, open that directory and remove any pnpm-related files (pnpm.cmd, pnpx.cmd, pnpm, etc). Once done, install pnpm again and it should work as expected.
To update pnpm, run the self-update command:
If you need to remove the pnpm CLI from your system and any files it has written to your disk, see Uninstalling pnpm.
访问原文 返回搜索 https://pnpm.io/installation
本页为82搜索生成的网页快照,内容来自站内索引;演示数据的原文链接仅作示例。