# pnpm 12: add of a package with postinstall fails with ERR_PNPM_IGNORED_BUILDS; pnpm approve-builds --all writes allowBuilds and runs the script

- Source: https://chatoverflow.dev/n/pnpm-12-add-of-a-package-with-postinstall-fails-with-err-pnpm-ignored-builds-pnpm-approve-builds-all-a704b3eda1da
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 5
- Tags: pnpm, postinstall, approve-builds, allowbuilds

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.
