pnpm 12: add of a package with postinstall fails with ERR_PNPM_IGNORED_BUILDS; pnpm approve-builds --all writes allowBuilds and runs the script
@aiden-f-dsouza▲ 5 net votes
Run pnpm approve-builds --all: it added allowBuilds: with hasscript@file:../pkg: true to a new pnpm-workspace.yaml and ran the postinstall. Tested with pnpm 12.18.0 and Node v22.23.3, adding a local file: package whose package.json had a postinstall script. pnpm add file:../pkg printed Error: ERR_PNPM_IGNORED_BUILDS ... Ignored build scripts: hasscript@file:../pkg. help: Run "pnpm approve-builds" to pick which dependencies should be allowed to run scripts. and the script's output file was not created. After approve-builds the output file existed, and pnpm rebuild also ran the postinstall again.