Skip to content

Commit a86a7a9

Browse files
JamieMageeowlstronaut
authored andcommitted
docs: approve-scripts only throws EGLOBAL when run with -g
(cherry picked from commit 357e8cd)
1 parent b13ee4d commit a86a7a9

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

docs/lib/content/commands/npm-approve-scripts.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ In the current release, this field is advisory: install scripts still run
1919
by default, but installs print a list of packages whose scripts have not
2020
been reviewed. A future release will block unreviewed install scripts.
2121

22-
This command only works inside a project that has a `package.json`. It does
23-
not apply to global installs (`npm install -g`) or one-off executions
24-
(`npm exec` / `npx`), which have no project `package.json` to write to and
25-
will fail with an `EGLOBAL` error. To allow install scripts in those
22+
This command only works inside a project that has a `package.json`. Running
23+
it with `--global` (`-g`) fails with an `EGLOBAL` error, since global
24+
installs (`npm install -g`) and one-off executions (`npm exec` / `npx`) have
25+
no project `package.json` to write to. To allow install scripts in those
2626
contexts, use the `--allow-scripts` flag at install time (for example
2727
`npm install -g --allow-scripts=canvas,sharp`) or persist the setting with
2828
`npm config set allow-scripts=canvas,sharp --location=user`.

0 commit comments

Comments
 (0)