pnpm approve-builds
버전 10.1.0에서 추가됨
설치 중 스크립트 실행을 위한 종속성을 승인합니다.
승인된 종속성은 allowBuilds 맵, 즉 pnpm-workspace.yaml에 있는 맵에 값 true로 추가되고, 승인되지 않은 종속성은 값 false로 저장됩니다. 원한다면 이 설정을 수동으로 업데이트할 수도 있습니다.
사용#
인수 없이 pnpm approve-builds를 실행하여 대화형 프롬프트를 사용하거나 패키지 이름을 위치 인수로 전달할 수 있습니다:
pnpm approve-builds esbuild fsevents !core-js
Running pnpm approve-builds without package arguments or --all when packages are awaiting approval requires an interactive terminal outside CI (ERR_PNPM_APPROVE_BUILDS_NON_INTERACTIVE).
패키지 이름 앞에 !를 붙이면 해당 패키지를 거부합니다. 언급된 패키지만 영향을 받습니다; 나머지는 그대로 유지됩니다.
Since v11.26.0, a decision is saved even when nothing is awaiting approval, so a policy can be written before the package is installed. A named package that is not awaiting approval is reported with a warning rather than an error, and is not rebuilt: it may not be installed yet, and rebuilding it would need a lockfile the project may not have. An argument that names no package at all is rejected before anything is written.
설치 중에 무시된 빌드가 있는 패키지 중 아직 allowBuilds에 나열되지 않은 것은 자리 표시자 값과 함께 pnpm-workspace.yaml에 자동으로 추가되며, true 또는 false로 직접 설정할 수 있습니다.
Since v11.23.0, writing allowBuilds also removes onlyBuiltDependencies, onlyBuiltDependenciesFile, neverBuiltDependencies, and ignoredBuiltDependencies from pnpm-workspace.yaml. allowBuilds replaced those settings in pnpm 11 and they have been ignored since, so a workspace migrated from pnpm 10 kept them around looking active.
옵션#
--all#
버전 10.32.0에서 추가됨
대화형 프롬프트 없이 보류 중인 모든 빌드를 승인합니다.
--global, -g#
Approve builds for globally installed packages.
pnpm gathers the packages awaiting approval across every isolated install
group, asks about them once, and
writes a single policy into the pnpm-workspace.yaml of the global packages
directory. Only the groups that actually contain an approved package are then
rebuilt.
Removed in v11.0.0, back in v11.24.0
Isolated global installs gave every install group its own manifest, and
pnpm approve-builds -g was removed rather than made to guess which one to
write to. Since v11.24.0 it writes one policy for all of them, so it works
again. From v11.0.0 until v11.24.0, use --allow-build when
installing globally (e.g. pnpm add -g --allow-build=esbuild esbuild), or
answer the prompt pnpm shows during a global install. Both options remain
available if you prefer to decide at install time.