설치하기

필수 구성 요소#

독립 실행형 스크립트나 @pnpm/exe로 pnpm을 설치하지 않는다면, 시스템에 Node.js(v22 이상)가 설치되어 있어야 합니다.

스크립트로 설치하기#

Node.js가 설치되어 있지 않더라도 다음 명령어를 통해 pnpm을 설치할 수 있습니다.

윈도우#

경고

이 방식으로 pnpm 설치 시 가끔 Windows Defender에서 실행 파일을 차단할 수 있습니다.

이 문제로 인해 현재 Windows에서는 npm을 사용하여 pnpm을 설치하는 것을 권장합니다.

Powershell:

$env:PNPM_VERSION="latest-11"; 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#

Not supported on Intel macOS and arm64 musl Linux

The standalone script and @pnpm/exe do not run on Intel Macs (darwin-x64) or on arm64 musl Linux, such as Alpine on ARM. Install the pnpm package, which runs on your system Node.js, with npm install -g pnpm@latest-11 instead. On arm64 musl Linux you can also use pnpm 12, which has a native binary for it. See #11423 and #10443 for context.

curl -fsSL https://get.pnpm.io/install.sh | env PNPM_VERSION=latest-11 sh -

curl이 설치되어 있지 않은 경우에는 wget을 사용할 수 있습니다.

wget -qO- https://get.pnpm.io/install.sh | env PNPM_VERSION=latest-11 sh -

Linux 런타임 요구 사항

The install script picks a glibc or musl build based on your system's libc. A separate musl build is provided for Alpine and other musl-based distros on x64. The glibc build requires glibc 2.27 or newer plus libatomic.so.1. Both are present on most full distros but may be missing from minimal container images. error while loading shared libraries: libatomic.so.1이 표시되면 배포판의 패키지 관리자로 설치하세요:

  • Debian/Ubuntu: apt-get install -y libatomic1
  • Fedora/RHEL: dnf install -y libatomic

팁

그런 다음 pnpm runtime 명령을 사용하여 Node.js를 설치할 수 있습니다.

Docker 컨테이너에서#

# bash
wget -qO- https://get.pnpm.io/install.sh | env PNPM_VERSION=latest-11 ENV="$HOME/.bashrc" SHELL="$(which bash)" bash -
# sh
wget -qO- https://get.pnpm.io/install.sh | env PNPM_VERSION=latest-11 ENV="$HOME/.shrc" SHELL="$(which sh)" sh -
# dash
wget -qO- https://get.pnpm.io/install.sh | env PNPM_VERSION=latest-11 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 latest-11

팁

pnpm을 CI 서버에서 사용하고 싶나요? 참조: 연속 통합.

호환성#

Node.js 버전에 호환되는 pnpm 버전 목록입니다.

Node.js pnpm 8 pnpm 9 pnpm 10 pnpm 11
Node.js 14 ❌ ❌ ❌ ❌
Node.js 16 ✔️ ❌ ❌ ❌
Node.js 18 ✔️ ✔️ ✔️ ❌
Node.js 20 ✔️ ✔️ ✔️ ❌
Node.js 22 ✔️ ✔️ ✔️ ✔️
Node.js 24 ✔️ ✔️ ✔️ ✔️
Node.js 26 ✔️ ✔️ ✔️ ✔️

문제 해결 안내#

만약 pnpm이 손상되어 다시 설치해도 문제를 해결할 수 없는 경우 PATH에서 수동으로 제거해야 할 수도 있습니다.

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 업데이트하기#

To update to the newest pnpm 11, run the self-update command with the major:

pnpm self-update 11

A bare pnpm self-update follows npm's latest tag, which now points at pnpm 12. See Installing pnpm v12 if that is what you want.

pnpm 삭제#

시스템에서 pnpm CLI와 pnpm이 디스크에 기록한 모든 파일을 제거해야 한다면 Uninstalling pnpm을 참조하세요.