pnpm exec
프로젝트 범위에서 셸 명령을 실행합니다.
node_modules/.bin이 PATH에 추가되므로, pnpm exec로 종속성의 명령을 실행할 수 있습니다. The name of the current package is available through the environment variable PNPM_PACKAGE_NAME.
예시#
If you have Jest as a dependency of your project, there is no need to install Jest globally. Run it with pnpm exec:
pnpm exec jest
The exec part is actually optional when the command is not in conflict with a builtin pnpm command, so you may also run:
pnpm jest
옵션#
pnpm reads its own options up to the command name, before or after the exec keyword. Everything after the command name is passed to the executed command.
Both of these run jest in every project of the workspace:
pnpm -r exec jest
pnpm exec -r jest
This one runs jest in the current project only, with -r as an argument of jest:
pnpm exec jest -r
--recursive, -r#
워크스페이스 내의 모든 프로젝트에서 셸 명령을 실행합니다. The recursive options, such as --workspace-concurrency, --[no-]sort, and --reverse, apply.
예시#
모든 패키지의 node_modules 설치 정리:
pnpm -r exec rm -rf node_modules
모든 패키지에 대한 패키지 정보를 봅니다. 환경 변수가 작동하려면 --shell-mode(또는 -c) 옵션과 함께 사용해야 합니다.
pnpm -rc exec pnpm view \$PNPM_PACKAGE_NAME
--no-reporter-hide-prefix#
명령을 병렬로 실행할 때 접두사를 숨기지 마세요.
--resume-from <package_name>#
Resume execution at a particular project. pnpm skips the projects a matching
record of the previous recursive exec says already passed. Without such a
record, it omits the named project's transitive dependencies, but still runs
the named project, its dependents, and unrelated projects in the selected
graph. See Workspace task
orchestration.
--parallel#
동시성과 토폴로지 정렬을 완전히 무시하고, 일치하는 모든 패키지에서 지정한 스크립트를 즉시 실행합니다. 긴 빌드 프로세스와 같은 많은 패키지에 대한 장기 실행 프로세스에서 선호되는 플래그입니다.
--shell-mode, -c#
Runs the command inside a shell. Uses /bin/sh on UNIX and cmd.exe on Windows.