pnpm setup

Installs the running pnpm into PNPM_HOME and adds it to PATH. The standalone installation scripts of pnpm run this command, for instance https://get.pnpm.io/install.sh.

pnpm setup [--force] [--no-modify-path]

setup은 다음 조치를 수행합니다.

  • pnpm CLI에 대한 홈 디렉토리를 생성합니다.
  • 셸 구성 파일을 업데이트하여 pnpm 홈 디렉터리를 PATH에 추가합니다
  • installs the running pnpm executable as a global package
  • writes the pn, pnpx, and pnx scripts to $PNPM_HOME/bin, the directory of globally installed binaries

To make a runtime command project-aware after setup, see pnpm shim.

If pnpm setup cannot tell which shell configuration file to update, for example in a container where SHELL is not set, it still installs pnpm. It then prints the PNPM_HOME and PATH lines to add to your shell configuration yourself.

On Windows, if the registry environment values cannot be read or written, pnpm setup still installs pnpm. It prints commands to set PNPM_HOME and PATH in the current PowerShell session. Add these commands to your PowerShell profile to use pnpm in future sessions without registry access.

When running on GitHub Actions, pnpm setup also appends PNPM_HOME and the global bin directory to the GitHub Actions environment files (GITHUB_ENV and GITHUB_PATH), so later steps in the same job can run pnpm add --global and other global commands.

옵션#

--force, -f#

Override the PNPM_HOME environment variable if it already exists.

--no-modify-path#

Install pnpm without adding it to PATH. The shell configuration file, the Windows registry, and the GitHub Actions environment files are left unchanged. pnpm setup prints the PNPM_HOME and PATH lines to add yourself.

Use this when you manage your shell configuration yourself, or when pnpm is installed for a user that has no login shell, as in a container image.