pnpm CLI
npm과의 차이점
npm과 달리 pnpm은 모든 옵션의 유효성을 검사합니다. 예를 들어, pnpm install --target_arch x64
은 --target_arch
가 pnpm install
에 유효한 옵션이 아니기 때문에 실패할 겁니다.
그러나 일부 의존성 패키지는 npm_config_
환경 변수를 사용할 수도 있으며, 이는 CLI 옵션을 통해 주어져야 합니다. 이러한 경우, 아래와 같은 옵션이 있습니다:
- 환경 변수를 명시적으로 설정합니다:
npm_config_target_arch=x64 pnpm install
- 옵션을
--config.
를 통해 설정합니다:pnpm install --config.target_arch=x64
옵션
-C <path>, --dir <path>
pnpm이 현재 작업 디렉토리가 아닌 <path>
디렉토리에서 실행됩니다.
-w, --workspace-root
Added in: v5.6.0
Run as if pnpm was started in the root of the workspace instead of the current working directory.
Commands
For more information, see the documentation for individual CLI commands. Here is a list of handy npm equivalents to get you started:
npm | pnpm |
---|---|
npm install | pnpm install |
npm i <pkg> | [pnpm add <pkg> ] |
npm run <cmd> | [pnpm <cmd> ] |
When an unknown command is used, pnpm will search for a script with the given name, so pnpm run lint
is the same as pnpm lint
. If there is no script with the specified name, then pnpm will execute the command as a shell script, so you can do things like pnpm eslint
(see pnpm exec).