pnpm approve-builds
新增于:v10.1.0
🌐 Added in: v10.1.0
批准在安装期间运行脚本的依赖。
🌐 Approve dependencies for running scripts during installation.
经过批准的依赖会以值 true 添加到 pnpm-workspace.yaml 中的 allowBuilds 映射中,而未经批准的依赖则以值 false 保存。如果愿意,你也可以手动更新这些设置。
🌐 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 also update these settings manually if you prefer.
用法
🌐 Usage
你可以在不带参数的情况下运行 pnpm approve-builds 来获得交互式提示,或者将包名称作为位置参数传递:
🌐 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.
在安装过程中,尚未列在 allowBuilds 中的被忽略构建的包会自动添加到 pnpm-workspace.yaml 中,并带有占位符值,因此你可以手动将它们设置为 true 或 false。
🌐 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
🌐 Added in: v10.32.0
批准所有待处理的构建,无需互动提示。
🌐 Approve all pending builds without interactive prompts.
--global, -g
pnpm approve-builds -g 不再支持使用隔离的全局包。相反,在全局安装时请使用 --allow-build(例如,pnpm add -g --allow-build=esbuild esbuild),或者通过 pnpm 在全局安装期间显示的交互提示批准构建。