pnpm approve-builds

설치 중 스크립트 실행을 위한 종속성을 승인합니다.

승인된 종속성은 allowBuilds 맵, 즉 pnpm-workspace.yaml에 있는 맵에 값 true로 추가되고, 승인되지 않은 종속성은 값 false로 저장됩니다. 원한다면 이 설정을 수동으로 업데이트할 수도 있습니다.

Since v12.11.0, when pnpm-workspace.yaml already has a permissions setting, the decisions are written there as the build capability instead. To review agent skills as well, use pnpm approve.

사용#

인수 없이 pnpm approve-builds를 실행하여 대화형 프롬프트를 사용하거나 패키지 이름을 위치 인수로 전달할 수 있습니다:

pnpm approve-builds esbuild fsevents !core-js

A bare name only approves default-registry dependencies. To approve a file:, git, or tarball dependency, use the full selector shown by pnpm ignored-builds. For example, run pnpm approve-builds 'example@file:../example'.

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).

패키지 이름 앞에 !를 붙이면 해당 패키지를 거부합니다. 언급된 패키지만 영향을 받습니다; 나머지는 그대로 유지됩니다. Approved packages that are awaiting approval are rebuilt right away. Naming a package both approved and denied fails with ERR_PNPM_APPROVE_BUILDS_CONTRADICTING_ARGS.

Since v12.4.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.

During install, packages with ignored builds that are not yet listed in allowBuilds are automatically added to pnpm-workspace.yaml with the placeholder value set this to true or false, so you can manually set them to true or false.

Writing allowBuilds also removes the ignored legacy settings onlyBuiltDependencies, onlyBuiltDependenciesFile, neverBuiltDependencies, and ignoredBuiltDependencies from pnpm-workspace.yaml.

옵션#

--all#

대화형 프롬프트 없이 보류 중인 모든 빌드를 승인합니다. Cannot be combined with package names (ERR_PNPM_APPROVE_BUILDS_ALL_WITH_ARGS).

--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 the decisions to globalPackagesConfig.permissions in the global config.yaml. Only the groups that actually contain an approved package are then rebuilt.