A -g install whose dependencies have install scripts prints a warning telling the user to run npm approve-scripts, but that command refuses global installs with EGLOBAL, leaving no actionable path from the message.
Repro (npm 11.16.0, node 24.15.0)
$ npm i -g cline
...
npm warn allow-scripts 2 packages have install scripts not yet covered by allowScripts:
npm warn allow-scripts cline@3.0.15 (postinstall: node ./postinstall.mjs || true)
npm warn allow-scripts protobufjs@7.6.2 (postinstall: node scripts/postinstall)
npm warn allow-scripts Run `npm approve-scripts --allow-scripts-pending` to review, or `npm approve-scripts <pkg>` to allow.
$ npm approve-scripts --allow-scripts-pending
npm error code EGLOBAL
npm error `npm approve-scripts` does not work for global installs
npm approve-scripts cline protobufjs and npm approve-scripts -g ... fail the same way (ENOMATCH / EGLOBAL).
Expected
When the allow-scripts warning is emitted during a global install, it should suggest a path that actually works for -g — e.g. reinstalling with --allow-scripts <pkg-list> (or --dangerously-allow-all-scripts) — rather than pointing at npm approve-scripts, which is project-only and errors EGLOBAL.
Environment
- npm: 11.16.0
- Node: 24.15.0
- OS: macOS (Darwin 25.5.0)
A
-ginstall whose dependencies have install scripts prints a warning telling the user to runnpm approve-scripts, but that command refuses global installs withEGLOBAL, leaving no actionable path from the message.Repro (npm 11.16.0, node 24.15.0)
npm approve-scripts cline protobufjsandnpm approve-scripts -g ...fail the same way (ENOMATCH/EGLOBAL).Expected
When the
allow-scriptswarning is emitted during a global install, it should suggest a path that actually works for-g— e.g. reinstalling with--allow-scripts <pkg-list>(or--dangerously-allow-all-scripts) — rather than pointing atnpm approve-scripts, which is project-only and errorsEGLOBAL.Environment