설치하기
필수 구성 요소#
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.
Supported platforms#
pnpm 12 ships a prebuilt binary for each of these targets:
| Operating system | Architectures |
|---|---|
| Linux (glibc) | x64, arm64, riscv64, ppc64le, s390x |
| Linux (musl) | x64, arm64 |
| macOS | arm64, x64 |
| Windows | x64, arm64 |
| FreeBSD | x64 |
| NetBSD | x64 |
| Android | arm64, x64 |
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.
pnpm으로 설치하기#
If you already have pnpm v11.10.0 or newer, update directly to pnpm 12:
pnpm self-update
Inside a project that pins pnpm through the packageManager field, self-update only updates that pin instead of installing pnpm globally.
스크립트로 설치하기#
Node.js가 설치되어 있지 않더라도 다음 명령어를 통해 pnpm을 설치할 수 있습니다.
윈도우#
경고
이 방식으로 pnpm 설치 시 가끔 Windows Defender에서 실행 파일을 차단할 수 있습니다.
이 문제로 인해 현재 Windows에서는 npm을 사용하여 pnpm을 설치하는 것을 권장합니다.
Powershell:
Invoke-WebRequest https://get.pnpm.io/install.ps1 -UseBasicParsing | Invoke-Expression
On Windows, Microsoft Defender can slow down installation of packages. PowerShell을 관리자 권한으로 실행한 뒤 다음 명령어를 실행하여 pnpm을 Microsoft Defender의 제외 폴더 목록에 추가할 수 있습니다:
Add-MpPreference -ExclusionPath $(pnpm store path)
POSIX systems#
curl -fsSL https://get.pnpm.io/install.sh | sh -
curl이 설치되어 있지 않은 경우에는 wget을 사용할 수 있습니다.
wget -qO- https://get.pnpm.io/install.sh | sh -
팁
그런 다음 pnpm runtime 명령을 사용하여 Node.js를 설치할 수 있습니다.
Docker 컨테이너에서#
# bash
wget -qO- https://get.pnpm.io/install.sh | env ENV="$HOME/.bashrc" SHELL="$(which bash)" bash -
# sh
wget -qO- https://get.pnpm.io/install.sh | env ENV="$HOME/.shrc" SHELL="$(which sh)" sh -
# dash
wget -qO- https://get.pnpm.io/install.sh | env ENV="$HOME/.dashrc" SHELL="$(which dash)" dash -
특정 버전 설치하기#
Before running the install script, you may optionally set an env variable PNPM_VERSION to install a specific version of pnpm:
curl -fsSL https://get.pnpm.io/install.sh | env PNPM_VERSION=<version> sh -
npm 사용하기#
npx get-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:
npm install -g pnpm@latest
팁
pnpm을 CI 서버에서 사용하고 싶나요? 참조: Continuous Integration.
호환성#
Here is a list of the supported pnpm versions with respective Node.js version support.
| Node.js | pnpm 10 | pnpm 11 | pnpm 12 |
|---|---|---|---|
| Node.js 18 | ✔️ | ❌ | ✔️ |
| Node.js 20 | ✔️ | ❌ | ✔️ |
| Node.js 22 | ✔️ | ✔️ | ✔️ |
| Node.js 24 | ✔️ | ✔️ | ✔️ |
| Node.js 26 | ✔️ | ✔️ | ✔️ |
pnpm 12는 npm으로 설치할 때만 Node.js가 필요합니다. 독립 실행 스크립트로 설치한 버전은 Node.js 없이 실행됩니다.
문제 해결 안내#
pnpm이 손상되어 다시 설치해도 문제를 해결할 수 없는 경우 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:
C:\src>pnpm install
internal/modules/cjs/loader.js:883
throw err;
^
Error: Cannot find module 'C:\Users\Bence\AppData\Roaming\npm\pnpm-global\4\node_modules\pnpm\bin\pnpm.js'
←[90m at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)←[39m
←[90m at Function.Module._load (internal/modules/cjs/loader.js:725:27)←[39m
←[90m at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)←[39m
←[90m at internal/main/run_main_module.js:17:47←[39m {
code: ←[32m'MODULE_NOT_FOUND'←[39m,
requireStack: []
}
먼저, which pnpm을 실행하여 pnpm의 위치를 찾으세요. 만약 Windows를 사용하는 경우 where.exe pnpm.*을 실행하세요.
그럼 pnpm이 어디에 있는지 찾을 수 있을 겁니다. 예:
$ which pnpm
/c/Program Files/nodejs/pnpm
이제 pnpm CLI의 위치를 알았으니, 해당 폴더를 열고 pnpm과 관련된 모든 파일(pnpm.cmd, pnpx.cmd, pnpm 등)을 제거합니다.
완료된 후, pnpm을 다시 설치하면 제대로 작동할 것입니다.
pnpm 업데이트하기#
pnpm을 업데이트하려면, self-update 명령을 실행하세요:
pnpm self-update
pnpm 삭제#
시스템과 디스크에 기록된 모든 파일에서 pnpm CLI를 제거해야 하는 경우 Uninstalling pnpm을 참조하세요.