pnpm self-update

최신 버전 또는 지정된 버전으로 pnpm을 업데이트합니다.

Without a version, pnpm updates to the latest dist-tag and does not downgrade. To go back to an older version, pass it explicitly.

pnpm self-update [<version>]

사용 예:

pnpm self-update
pnpm self-update 10
pnpm self-update next-10
pnpm self-update 10.6.5

동작#

프로젝트 컨텍스트에 따라 pnpm self-update의 동작이 달라집니다:

프로젝트에서 pnpm 버전을 고정한 경우#

When the project's manifest has a packageManager field set to pnpm (or a devEngines.packageManager entry for pnpm), self-update updates the pinned version in that manifest to the resolved one. In a workspace, this is the workspace root's manifest, even when the command runs in a workspace package. An engines.pnpm range in the same manifest moves to the resolved version too. An exact version, or a ^ or ~ range on a full version, keeps its form. Any other range stays as it is if it accepts the resolved version. If it does not, it moves to the resolved version with the operator its form implies. For example, 12.2 becomes ~13.0.0. A comparator range such as >=12.0.0 <13.0.0 becomes ^13.0.0. It also installs the resolved version globally, as it does outside a project. The pin is written after the global install, so a failed install leaves the project unchanged.

프로젝트 외부(또는 pnpm 고정이 무시되는 경우)#

프로젝트가 pnpm을 고정하지 않았거나 pmOnFail: ignore를 통해 고정이 무시되는 경우, self-update는 확인된 pnpm 버전을 전역으로 설치하고 PNPM_HOME에 링크하여 시스템에서 활성 pnpm 바이너리가 되도록 합니다.

When Homebrew or Corepack manages pnpm#

If Homebrew installed pnpm or Corepack runs it, pnpm self-update leaves the global pnpm alone. In a project that pins pnpm, it still updates the pin. Outside such a project, it fails. Update a Homebrew install with brew upgrade pnpm (or brew upgrade pnpm@<major> for a versioned formula).

When another pnpm comes first on PATH#

After installing, self-update looks up pnpm on PATH. If another installer's copy comes before the global bin directory, your shell keeps running that copy, and self-update prints a warning that names it. If pnpm recognizes the installer, the warning gives the command that removes that copy. Otherwise it tells you to move the global bin directory ahead of it on PATH. pnpm setup prints the same warning. It skips the warning when it writes a shell configuration that puts the global bin directory first. On Windows it checks the saved system and user Path instead, and keeps the warning only when the other copy still comes first there.

프로젝트 설정은 무시됩니다#

pnpm self-update takes no instruction from the project it is run in:

  • pnpm은 pnpm 버전을 전환할 때 사용되는 것과 동일한 신뢰할 수 있는 레지스트리 및 인증 구성을 통해 가져오므로, 프로젝트의 .npmrc 또는 pnpm-workspace.yaml이 다운로드를 다른 곳으로 리디렉션하거나 자격 증명을 첨부할 수 없으며, 프로젝트의 기본 .pnpmfile.(c|m)js도 로드되지 않습니다. 신뢰할 수 있는 소스의 Pnpmfile(pnpmfile 설정, 전역 pnpmfile, 구성 종속성)은 계속 적용됩니다.
  • 프로젝트의 minimumReleaseAge, trustPolicy, ci 설정은 self-update에 영향을 주지 않습니다. 이 설정들은 여전히 프로젝트 자체의 종속성에는 적용됩니다; self-update의 경우 이 값들은 내장 기본값, 전역 구성, PNPM_CONFIG_* 환경 변수 또는 명령줄 플래그에서 가져옵니다. 이를 통해 저장소가 릴리스 경과 기간 대기를 면제하거나 이를 높여 오래된 pnpm에 머물게 하는 것을 막고, pnpm 다운로드를 보호하는 신뢰 검사를 약화시키는 것도 방지합니다.

self-update가 minimumReleaseAge 기준보다 최신인 버전을 거부하면, 대화형 실행에서는 그래도 업데이트할지 묻습니다; 비대화형 실행은 여전히 실패합니다. CI는 TTY를 연결하는 러너에서도 절대 프롬프트를 표시하지 않습니다. Declining the prompt fails with ERR_PNPM_MINIMUM_RELEASE_AGE_DENIED. A version that violates the policies fails with ERR_PNPM_PNPM_RELEASE_POLICY_VIOLATION. pnpm verifies the identity of the release before installing it. A mismatch fails with ERR_PNPM_PNPM_ENGINE_IDENTITY_MISMATCH, and a release pnpm cannot verify fails with ERR_PNPM_PNPM_ENGINE_IDENTITY_UNVERIFIABLE.

What gets installed#

For pnpm 12 and newer, self-update installs the unscoped pnpm package. 네이티브 바이너리는 @pnpm/exe.<platform>-<arch> packages, which pnpm links directly, with no Node.js launcher. An older version is installed as @pnpm/exe on platforms where it runs, and as pnpm otherwise.