Skip to content

allow-scripts warning on global install suggests npm approve-scripts, which errors EGLOBAL #9463

Description

@TomCruiseTorpedo

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   [email protected] (postinstall: node ./postinstall.mjs || true)
npm warn allow-scripts   [email protected] (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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions