跳至主要內容
版本:11.x

pnpm approve-builds

Added in: v10.1.0

批准在安裝期間執行腳本的依賴套件。

The approved dependencies are added to the allowBuilds map in pnpm-workspace.yaml with a value of true, while unapproved ones are saved with a value of false. 如果你願意,也可以手動更新這些設定。

使用方法

You can run pnpm approve-builds without arguments to get an interactive prompt, or pass package names as positional arguments:

pnpm approve-builds esbuild fsevents !core-js

Prefix a package name with ! to deny it. Only mentioned packages are affected; the rest are left untouched.

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

Options

--all

新增於 v10.32.0

Approve all pending builds without interactive prompts.

--global, -g

Removed in v11.0.0

pnpm approve-builds -g is no longer supported with isolated global packages. Instead, use --allow-build when installing globally (e.g., pnpm add -g --allow-build=esbuild esbuild), or approve builds via the interactive prompt that pnpm shows during global install.