deps: upgrade npm to 11.18.0

PR-URL: https://github.com/nodejs/node/pull/64199
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
Reviewed-By: Richard Lau <richard.lau@ibm.com>
This commit is contained in:
npm CLI robot authored and RafaelGSS committed 2026-07-29 10:31:25 -03:00
1 parent abb62f961f
commit ad2f3bc95b
293 files changed
+3850 -729

No files matched your search

+8
View File
@@ -59,6 +59,14 @@ the command cannot infer. Existing `false` entries always win;
`approve-scripts` will not silently re-allow a package you previously
denied.
If a registry dependency has no `resolved` URL in your `package-lock.json`
(for example, an older lockfile or one written with
`omit-lockfile-registry-resolved`), npm cannot verify a trusted version for
it and cannot pin it: a `pkg@1.2.3` entry never matches, so the package
keeps appearing under `--allow-scripts-pending`. `approve-scripts` approves
these by name (`pkg: true`) and warns when it does. To restore pinning,
refresh the lockfile with `npm install`.
### Examples
```bash
+14 -2
View File
@@ -74,8 +74,16 @@ Sets the strategy for installing packages in node_modules. hoisted
(default): Install non-duplicated in top-level, and duplicated as necessary
within directory structure. nested: (formerly --legacy-bundling) install in
place, no hoisting. shallow (formerly --global-style) only install direct
deps at top-level. linked: (experimental) install in node_modules/.store,
link in place, unhoisted.
deps at top-level. linked: install in node_modules/.store, link in place,
unhoisted.
We recommend that package authors use `--install-strategy=linked` during
development to catch undeclared ("phantom") dependencies before publishing:
the isolated layout only exposes a package's declared dependencies, so an
`import` of a package that was never added to `package.json` can fail
instead of resolving by accident and shipping broken. See [Catching
undeclared ("phantom")
dependencies](/using-npm/developers#catching-undeclared-phantom-dependencies).
@@ -298,6 +306,10 @@ silently skipped; this setting only affects unreviewed entries.
`--ignore-scripts` and `--dangerously-allow-all-scripts` both override this
setting.
Optional dependencies that cannot be installed on the current platform or
engine (a non-matching `os`, `cpu`, or `libc`) are not flagged, because
their install scripts never run.
#### `dangerously-allow-all-scripts`
+10 -2
View File
@@ -74,8 +74,16 @@ Sets the strategy for installing packages in node_modules. hoisted
(default): Install non-duplicated in top-level, and duplicated as necessary
within directory structure. nested: (formerly --legacy-bundling) install in
place, no hoisting. shallow (formerly --global-style) only install direct
deps at top-level. linked: (experimental) install in node_modules/.store,
link in place, unhoisted.
deps at top-level. linked: install in node_modules/.store, link in place,
unhoisted.
We recommend that package authors use `--install-strategy=linked` during
development to catch undeclared ("phantom") dependencies before publishing:
the isolated layout only exposes a package's declared dependencies, so an
`import` of a package that was never added to `package.json` can fail
instead of resolving by accident and shipping broken. See [Catching
undeclared ("phantom")
dependencies](/using-npm/developers#catching-undeclared-phantom-dependencies).
+4
View File
@@ -194,6 +194,10 @@ silently skipped; this setting only affects unreviewed entries.
`--ignore-scripts` and `--dangerously-allow-all-scripts` both override this
setting.
Optional dependencies that cannot be installed on the current platform or
engine (a non-matching `os`, `cpu`, or `libc`) are not flagged, because
their install scripts never run.
#### `dangerously-allow-all-scripts`
+10 -2
View File
@@ -25,8 +25,16 @@ Sets the strategy for installing packages in node_modules. hoisted
(default): Install non-duplicated in top-level, and duplicated as necessary
within directory structure. nested: (formerly --legacy-bundling) install in
place, no hoisting. shallow (formerly --global-style) only install direct
deps at top-level. linked: (experimental) install in node_modules/.store,
link in place, unhoisted.
deps at top-level. linked: install in node_modules/.store, link in place,
unhoisted.
We recommend that package authors use `--install-strategy=linked` during
development to catch undeclared ("phantom") dependencies before publishing:
the isolated layout only exposes a package's declared dependencies, so an
`import` of a package that was never added to `package.json` can fail
instead of resolving by accident and shipping broken. See [Catching
undeclared ("phantom")
dependencies](/using-npm/developers#catching-undeclared-phantom-dependencies).
+14 -2
View File
@@ -27,8 +27,16 @@ Sets the strategy for installing packages in node_modules. hoisted
(default): Install non-duplicated in top-level, and duplicated as necessary
within directory structure. nested: (formerly --legacy-bundling) install in
place, no hoisting. shallow (formerly --global-style) only install direct
deps at top-level. linked: (experimental) install in node_modules/.store,
link in place, unhoisted.
deps at top-level. linked: install in node_modules/.store, link in place,
unhoisted.
We recommend that package authors use `--install-strategy=linked` during
development to catch undeclared ("phantom") dependencies before publishing:
the isolated layout only exposes a package's declared dependencies, so an
`import` of a package that was never added to `package.json` can fail
instead of resolving by accident and shipping broken. See [Catching
undeclared ("phantom")
dependencies](/using-npm/developers#catching-undeclared-phantom-dependencies).
@@ -251,6 +259,10 @@ silently skipped; this setting only affects unreviewed entries.
`--ignore-scripts` and `--dangerously-allow-all-scripts` both override this
setting.
Optional dependencies that cannot be installed on the current platform or
engine (a non-matching `os`, `cpu`, or `libc`) are not flagged, because
their install scripts never run.
#### `dangerously-allow-all-scripts`
+166
View File
@@ -0,0 +1,166 @@
---
title: npm-install-scripts
section: 1
description: Manage install-script approvals for dependencies
---
### Synopsis
```bash
npm install-scripts approve <pkg> [<pkg> ...]
npm install-scripts approve --all
npm install-scripts deny <pkg> [<pkg> ...]
npm install-scripts deny --all
npm install-scripts ls
npm install-scripts prune
```
Note: This command is unaware of workspaces.
### Description
Manages the `allowScripts` field in your project's `package.json`, which
records which of your dependencies are permitted to run install scripts
(`preinstall`, `install`, `postinstall`, and `prepare` for non-registry
sources). This is the recommended way to maintain that field.
Dependency install scripts are blocked by default. Install commands
silently skip lifecycle scripts for any dependency that does not have a
matching entry in `allowScripts`, and end with a list of the packages
whose scripts were skipped so you can review them here.
This command only works inside a project that has a `package.json`. Running
it with `--global` (`-g`) fails with an `EGLOBAL` error, since global
installs (`npm install -g`) and one-off executions (`npm exec` / `npx`) have
no project `package.json` to write to. To allow install scripts in those
contexts, use the `--allow-scripts` flag at install time (for example
`npm install -g --allow-scripts=canvas,sharp`) or persist the setting with
`npm config set allow-scripts=canvas,sharp --location=user`.
There are four subcommands:
```bash
npm install-scripts approve <pkg> [<pkg> ...]
npm install-scripts approve --all
npm install-scripts deny <pkg> [<pkg> ...]
npm install-scripts deny --all
npm install-scripts ls
npm install-scripts prune
```
`approve` allows install scripts for the named packages. `<pkg>` matches
every installed version of that package. By default it writes pinned entries
(`pkg@1.2.3`), which keep their approval narrowed to the specific version you
reviewed. Pass `--no-allow-scripts-pin` to write name-only entries that allow
any future version. `--all` approves every package with unreviewed install
scripts in one go.
`deny` records an explicit denial for the named packages (a name-only `false`
entry), which survives `npm install-scripts approve --all` and excludes the
package from any future blanket approval. `--all` denies every package with
unreviewed install scripts.
`ls` is read-only: it lists every package whose install scripts are not yet
covered by `allowScripts`, without modifying `package.json`.
`prune` removes `allowScripts` entries that no longer match an installed
package with an install script, either because the package is no longer
installed (a transitive dependency changed, or a pinned `pkg@1.2.3` was
upgraded) or because it no longer has an install script. Both approvals
(`true`) and denials (`false`) are removed. It edits only the `allowScripts`
field in `package.json`, never `.npmrc` or `--allow-scripts`. Pass `--dry-run`
to preview without writing. Unparseable keys are left alone.
`approve` honours the asymmetric pin rule: if you re-approve a package whose
installed version has changed, the existing pin is rewritten to track the new
installed version. Multi-version statements (`pkg@1 || 2`) are left alone,
since they likely capture intent that the command cannot infer. Existing
`false` entries always win; `approve` will not silently re-allow a package you
previously denied.
The standalone commands [`npm approve-scripts`](/commands/npm-approve-scripts)
and [`npm deny-scripts`](/commands/npm-deny-scripts) are aliases for
`npm install-scripts approve` and `npm install-scripts deny`.
### Examples
```bash
# Approve all currently-installed install scripts after reviewing them
npm install-scripts approve --all
# Approve specific packages, pinned to their installed version
npm install-scripts approve canvas sharp
# Deny a package so it stays blocked
npm install-scripts deny telemetry-pkg
# Preview which packages still need review
npm install-scripts ls
# Preview stale allowScripts entries, then remove them
npm install-scripts prune --dry-run
npm install-scripts prune
```
### Configuration
#### `all`
* Default: false
* Type: Boolean
Show or act on all packages, not just the ones your project directly depends
on. For `npm outdated` and `npm ls` this lists every outdated or installed
package. For `npm approve-scripts` and `npm deny-scripts` it selects every
package with pending install scripts.
#### `allow-scripts-pin`
* Default: true
* Type: Boolean
Write pinned (`pkg@version`) entries when approving install scripts. Set to
`false` to write name-only entries that allow any version. Has no effect on
`npm deny-scripts`, which always writes name-only entries regardless of this
setting.
#### `dry-run`
* Default: false
* Type: Boolean
Indicates that you don't want npm to make any changes and that it should
only report what it would have done. This can be passed into any of the
commands that modify your local installation, eg, `install`, `update`,
`dedupe`, `uninstall`, as well as `pack` and `publish`.
Note: This is NOT honored by other network related commands, eg `dist-tags`,
`owner`, etc.
#### `json`
* Default: false
* Type: Boolean
Whether or not to output JSON data, rather than the normal output.
* In `npm pkg set` it enables parsing set values with JSON.parse() before
saving them to your `package.json`.
Not supported by all npm commands.
### See Also
* [npm approve-scripts](/commands/npm-approve-scripts)
* [npm deny-scripts](/commands/npm-deny-scripts)
* [npm install](/commands/npm-install)
* [npm rebuild](/commands/npm-rebuild)
* [package.json](/configuring-npm/package-json)
+24 -2
View File
@@ -68,8 +68,16 @@ Sets the strategy for installing packages in node_modules. hoisted
(default): Install non-duplicated in top-level, and duplicated as necessary
within directory structure. nested: (formerly --legacy-bundling) install in
place, no hoisting. shallow (formerly --global-style) only install direct
deps at top-level. linked: (experimental) install in node_modules/.store,
link in place, unhoisted.
deps at top-level. linked: install in node_modules/.store, link in place,
unhoisted.
We recommend that package authors use `--install-strategy=linked` during
development to catch undeclared ("phantom") dependencies before publishing:
the isolated layout only exposes a package's declared dependencies, so an
`import` of a package that was never added to `package.json` can fail
instead of resolving by accident and shipping broken. See [Catching
undeclared ("phantom")
dependencies](/using-npm/developers#catching-undeclared-phantom-dependencies).
@@ -328,6 +336,10 @@ silently skipped; this setting only affects unreviewed entries.
`--ignore-scripts` and `--dangerously-allow-all-scripts` both override this
setting.
Optional dependencies that cannot be installed on the current platform or
engine (a non-matching `os`, `cpu`, or `libc`) are not flagged, because
their install scripts never run.
#### `dangerously-allow-all-scripts`
@@ -375,6 +387,10 @@ sources, the standard precedence applies (cli > env > project > user >
global), so a higher-priority source can always relax or override a
lower-priority one.
As with `min-release-age`, when this cutoff blocks a fix that `npm audit
fix` would install, npm keeps the vulnerable version, warns, and exits with
a non-zero code.
Packages whose names match `min-release-age-exclude` are exempt from this
filter.
@@ -397,6 +413,12 @@ your `.npmrc` is preserved when npm internally spawns a sub-process with
apply, `before` wins within a single source and across sources the standard
precedence rules apply.
When this window stops `npm audit fix` from installing a patched version
(because the fix was published too recently), npm keeps the package at its
vulnerable version, warns that the fix was blocked, and exits with a
non-zero code. To install the fix, add the package to
`min-release-age-exclude`, or relax `min-release-age` or `before`.
Packages whose names match `min-release-age-exclude` are exempt from this
filter.
+24 -2
View File
@@ -410,8 +410,16 @@ Sets the strategy for installing packages in node_modules. hoisted
(default): Install non-duplicated in top-level, and duplicated as necessary
within directory structure. nested: (formerly --legacy-bundling) install in
place, no hoisting. shallow (formerly --global-style) only install direct
deps at top-level. linked: (experimental) install in node_modules/.store,
link in place, unhoisted.
deps at top-level. linked: install in node_modules/.store, link in place,
unhoisted.
We recommend that package authors use `--install-strategy=linked` during
development to catch undeclared ("phantom") dependencies before publishing:
the isolated layout only exposes a package's declared dependencies, so an
`import` of a package that was never added to `package.json` can fail
instead of resolving by accident and shipping broken. See [Catching
undeclared ("phantom")
dependencies](/using-npm/developers#catching-undeclared-phantom-dependencies).
@@ -670,6 +678,10 @@ silently skipped; this setting only affects unreviewed entries.
`--ignore-scripts` and `--dangerously-allow-all-scripts` both override this
setting.
Optional dependencies that cannot be installed on the current platform or
engine (a non-matching `os`, `cpu`, or `libc`) are not flagged, because
their install scripts never run.
#### `dangerously-allow-all-scripts`
@@ -717,6 +729,10 @@ sources, the standard precedence applies (cli > env > project > user >
global), so a higher-priority source can always relax or override a
lower-priority one.
As with `min-release-age`, when this cutoff blocks a fix that `npm audit
fix` would install, npm keeps the vulnerable version, warns, and exits with
a non-zero code.
Packages whose names match `min-release-age-exclude` are exempt from this
filter.
@@ -739,6 +755,12 @@ your `.npmrc` is preserved when npm internally spawns a sub-process with
apply, `before` wins within a single source and across sources the standard
precedence rules apply.
When this window stops `npm audit fix` from installing a patched version
(because the fix was published too recently), npm keeps the package at its
vulnerable version, warns that the fix was blocked, and exits with a
non-zero code. To install the fix, add the package to
`min-release-age-exclude`, or relax `min-release-age` or `before`.
Packages whose names match `min-release-age-exclude` are exempt from this
filter.
+10 -2
View File
@@ -138,8 +138,16 @@ Sets the strategy for installing packages in node_modules. hoisted
(default): Install non-duplicated in top-level, and duplicated as necessary
within directory structure. nested: (formerly --legacy-bundling) install in
place, no hoisting. shallow (formerly --global-style) only install direct
deps at top-level. linked: (experimental) install in node_modules/.store,
link in place, unhoisted.
deps at top-level. linked: install in node_modules/.store, link in place,
unhoisted.
We recommend that package authors use `--install-strategy=linked` during
development to catch undeclared ("phantom") dependencies before publishing:
the isolated layout only exposes a package's declared dependencies, so an
`import` of a package that was never added to `package.json` can fail
instead of resolving by accident and shipping broken. See [Catching
undeclared ("phantom")
dependencies](/using-npm/developers#catching-undeclared-phantom-dependencies).
+1 -1
View File
@@ -23,7 +23,7 @@ Note that nested packages will *also* show the paths to the specified packages.
For example, running `npm ls promzard` in npm's source tree will show:
```bash
npm@11.17.0 /path/to/npm
npm@11.18.0 /path/to/npm
└─┬ init-package-json@0.0.4
└── promzard@0.1.5
```
+10
View File
@@ -172,6 +172,10 @@ sources, the standard precedence applies (cli > env > project > user >
global), so a higher-priority source can always relax or override a
lower-priority one.
As with `min-release-age`, when this cutoff blocks a fix that `npm audit
fix` would install, npm keeps the vulnerable version, warns, and exits with
a non-zero code.
Packages whose names match `min-release-age-exclude` are exempt from this
filter.
@@ -194,6 +198,12 @@ your `.npmrc` is preserved when npm internally spawns a sub-process with
apply, `before` wins within a single source and across sources the standard
precedence rules apply.
When this window stops `npm audit fix` from installing a patched version
(because the fix was published too recently), npm keeps the package at its
vulnerable version, warns that the fix was blocked, and exits with a
non-zero code. To install the fix, add the package to
`min-release-age-exclude`, or relax `min-release-age` or `before`.
Packages whose names match `min-release-age-exclude` are exempt from this
filter.
+10
View File
@@ -284,6 +284,10 @@ sources, the standard precedence applies (cli > env > project > user >
global), so a higher-priority source can always relax or override a
lower-priority one.
As with `min-release-age`, when this cutoff blocks a fix that `npm audit
fix` would install, npm keeps the vulnerable version, warns, and exits with
a non-zero code.
Packages whose names match `min-release-age-exclude` are exempt from this
filter.
@@ -306,6 +310,12 @@ your `.npmrc` is preserved when npm internally spawns a sub-process with
apply, `before` wins within a single source and across sources the standard
precedence rules apply.
When this window stops `npm audit fix` from installing a patched version
(because the fix was published too recently), npm keeps the package at its
vulnerable version, warns that the fix was blocked, and exits with a
non-zero code. To install the fix, add the package to
`min-release-age-exclude`, or relax `min-release-age` or `before`.
Packages whose names match `min-release-age-exclude` are exempt from this
filter.
+4
View File
@@ -136,6 +136,10 @@ silently skipped; this setting only affects unreviewed entries.
`--ignore-scripts` and `--dangerously-allow-all-scripts` both override this
setting.
Optional dependencies that cannot be installed on the current platform or
engine (a non-matching `os`, `cpu`, or `libc`) are not flagged, because
their install scripts never run.
#### `dangerously-allow-all-scripts`
+24 -2
View File
@@ -177,8 +177,16 @@ Sets the strategy for installing packages in node_modules. hoisted
(default): Install non-duplicated in top-level, and duplicated as necessary
within directory structure. nested: (formerly --legacy-bundling) install in
place, no hoisting. shallow (formerly --global-style) only install direct
deps at top-level. linked: (experimental) install in node_modules/.store,
link in place, unhoisted.
deps at top-level. linked: install in node_modules/.store, link in place,
unhoisted.
We recommend that package authors use `--install-strategy=linked` during
development to catch undeclared ("phantom") dependencies before publishing:
the isolated layout only exposes a package's declared dependencies, so an
`import` of a package that was never added to `package.json` can fail
instead of resolving by accident and shipping broken. See [Catching
undeclared ("phantom")
dependencies](/using-npm/developers#catching-undeclared-phantom-dependencies).
@@ -338,6 +346,10 @@ silently skipped; this setting only affects unreviewed entries.
`--ignore-scripts` and `--dangerously-allow-all-scripts` both override this
setting.
Optional dependencies that cannot be installed on the current platform or
engine (a non-matching `os`, `cpu`, or `libc`) are not flagged, because
their install scripts never run.
#### `dangerously-allow-all-scripts`
@@ -385,6 +397,10 @@ sources, the standard precedence applies (cli > env > project > user >
global), so a higher-priority source can always relax or override a
lower-priority one.
As with `min-release-age`, when this cutoff blocks a fix that `npm audit
fix` would install, npm keeps the vulnerable version, warns, and exits with
a non-zero code.
Packages whose names match `min-release-age-exclude` are exempt from this
filter.
@@ -407,6 +423,12 @@ your `.npmrc` is preserved when npm internally spawns a sub-process with
apply, `before` wins within a single source and across sources the standard
precedence rules apply.
When this window stops `npm audit fix` from installing a patched version
(because the fix was published too recently), npm keeps the package at its
vulnerable version, warns that the fix was blocked, and exits with a
non-zero code. To install the fix, add the package to
`min-release-age-exclude`, or relax `min-release-age` or `before`.
Packages whose names match `min-release-age-exclude` are exempt from this
filter.
+1 -1
View File
@@ -14,7 +14,7 @@ Note: This command is unaware of workspaces.
### Version
11.17.0
11.18.0
### Description
+32 -3
View File
@@ -349,6 +349,10 @@ sources, the standard precedence applies (cli > env > project > user >
global), so a higher-priority source can always relax or override a
lower-priority one.
As with `min-release-age`, when this cutoff blocks a fix that `npm audit
fix` would install, npm keeps the vulnerable version, warns, and exits with
a non-zero code.
Packages whose names match `min-release-age-exclude` are exempt from this
filter.
@@ -1029,8 +1033,16 @@ Sets the strategy for installing packages in node_modules. hoisted
(default): Install non-duplicated in top-level, and duplicated as necessary
within directory structure. nested: (formerly --legacy-bundling) install in
place, no hoisting. shallow (formerly --global-style) only install direct
deps at top-level. linked: (experimental) install in node_modules/.store,
link in place, unhoisted.
deps at top-level. linked: install in node_modules/.store, link in place,
unhoisted.
We recommend that package authors use `--install-strategy=linked` during
development to catch undeclared ("phantom") dependencies before publishing:
the isolated layout only exposes a package's declared dependencies, so an
`import` of a package that was never added to `package.json` can fail
instead of resolving by accident and shipping broken. See [Catching
undeclared ("phantom")
dependencies](/using-npm/developers#catching-undeclared-phantom-dependencies).
@@ -1224,6 +1236,12 @@ your `.npmrc` is preserved when npm internally spawns a sub-process with
apply, `before` wins within a single source and across sources the standard
precedence rules apply.
When this window stops `npm audit fix` from installing a patched version
(because the fix was published too recently), npm keeps the package at its
vulnerable version, warns that the fix was blocked, and exits with a
non-zero code. To install the fix, add the package to
`min-release-age-exclude`, or relax `min-release-age` or `before`.
Packages whose names match `min-release-age-exclude` are exempt from this
filter.
@@ -1620,7 +1638,14 @@ registry (https://registry.npmjs.org) to the configured registry. If set to
"never", then use the registry value. If set to "always", then replace the
registry host with the configured host every time.
You may also specify a bare hostname (e.g., "registry.npmjs.org").
You may also specify a bare hostname (e.g., "registry.npmjs.org") to only
replace URLs coming from that host.
You may also specify a full URL including a path (e.g.,
"https://old-registry.example.com/npm/path"). In that case, resolved URLs
whose host and path begin with that prefix will have the entire prefix
replaced with the configured registry URL (host and path), without
duplicating path segments.
@@ -1877,6 +1902,10 @@ silently skipped; this setting only affects unreviewed entries.
`--ignore-scripts` and `--dangerously-allow-all-scripts` both override this
setting.
Optional dependencies that cannot be installed on the current platform or
engine (a non-matching `os`, `cpu`, or `libc`) are not flagged, because
their install scripts never run.
#### `strict-peer-deps`
+18
View File
@@ -171,6 +171,24 @@ to install it locally into the node_modules folder in that other place.
Then go into the node-repl, and try using require("my-thing") to bring in your module's main module.
#### Catching undeclared ("phantom") dependencies
Under the default hoisted `node_modules` layout, your package can `import` a dependency it never declared and still resolve it.
A transitive dependency hoisted alongside it, or your workspace root's `node_modules`, happens to satisfy the `import`.
That undeclared ("phantom") dependency passes your own build silently, then fails for anyone who installs your package on its own.
We recommend developing your package under [`install-strategy=linked`](/using-npm/config#install-strategy).
The isolated layout only exposes a package's *declared* dependencies, so an `import` of an undeclared package fails for you during development instead of resolving by accident, shipping broken, and failing for your users:
```bash
npm install --install-strategy=linked
npm test
```
> **Note:** This doesn't catch every case.
> A dependency that's still satisfied at your build by a `devDependency` or by your workspace root's `node_modules` can resolve fine for you and still be missing for whoever installs your package.
> So treat it as one check, not a guarantee, alongside auditing the dependencies your published package actually uses.
### Create a User Account
Create a user with the adduser command.
+2 -2
View File
@@ -186,9 +186,9 @@ npm command-line interface
<section id="content">
<header class="title">
<h1 id="----npm-access----11170">
<h1 id="----npm-access----11180">
<span>npm-access</span>
<span class="version">@11.17.0</span>
<span class="version">@11.18.0</span>
</h1>
<span class="description">Set access level on published packages</span>
</header>
+2 -2
View File
@@ -186,9 +186,9 @@ npm command-line interface
<section id="content">
<header class="title">
<h1 id="----npm-adduser----11170">
<h1 id="----npm-adduser----11180">
<span>npm-adduser</span>
<span class="version">@11.17.0</span>
<span class="version">@11.18.0</span>
</h1>
<span class="description">Add a registry user account</span>
</header>
+9 -2
View File
@@ -186,9 +186,9 @@ npm command-line interface
<section id="content">
<header class="title">
<h1 id="----npm-approve-scripts----11170">
<h1 id="----npm-approve-scripts----11180">
<span>npm-approve-scripts</span>
<span class="version">@11.17.0</span>
<span class="version">@11.18.0</span>
</h1>
<span class="description">Approve install scripts for specific dependencies</span>
</header>
@@ -238,6 +238,13 @@ to track the new installed version. Multi-version statements
the command cannot infer. Existing <code>false</code> entries always win;
<code>approve-scripts</code> will not silently re-allow a package you previously
denied.</p>
<p>If a registry dependency has no <code>resolved</code> URL in your <code>package-lock.json</code>
(for example, an older lockfile or one written with
<code>omit-lockfile-registry-resolved</code>), npm cannot verify a trusted version for
it and cannot pin it: a <code>pkg@1.2.3</code> entry never matches, so the package
keeps appearing under <code>--allow-scripts-pending</code>. <code>approve-scripts</code> approves
these by name (<code>pkg: true</code>) and warns when it does. To restore pinning,
refresh the lockfile with <code>npm install</code>.</p>
<h3 id="examples">Examples</h3>
<pre><code class="language-bash"># Approve all currently-installed install scripts after reviewing them
npm approve-scripts --all
+2 -2
View File
@@ -186,9 +186,9 @@ npm command-line interface
<section id="content">
<header class="title">
<h1 id="----npm-audit----11170">
<h1 id="----npm-audit----11180">
<span>npm-audit</span>
<span class="version">@11.17.0</span>
<span class="version">@11.18.0</span>
</h1>
<span class="description">Run a security audit</span>
</header>
+2 -2
View File
@@ -186,9 +186,9 @@ npm command-line interface
<section id="content">
<header class="title">
<h1 id="----npm-bugs----11170">
<h1 id="----npm-bugs----11180">
<span>npm-bugs</span>
<span class="version">@11.17.0</span>
<span class="version">@11.18.0</span>
</h1>
<span class="description">Report bugs for a package in a web browser</span>
</header>
+2 -2
View File
@@ -186,9 +186,9 @@ npm command-line interface
<section id="content">
<header class="title">
<h1 id="----npm-cache----11170">
<h1 id="----npm-cache----11180">
<span>npm-cache</span>
<span class="version">@11.17.0</span>
<span class="version">@11.18.0</span>
</h1>
<span class="description">Manipulates packages cache</span>
</header>
+14 -4
View File
@@ -186,9 +186,9 @@ npm command-line interface
<section id="content">
<header class="title">
<h1 id="----npm-ci----11170">
<h1 id="----npm-ci----11180">
<span>npm-ci</span>
<span class="version">@11.17.0</span>
<span class="version">@11.18.0</span>
</h1>
<span class="description">Clean install a project</span>
</header>
@@ -251,8 +251,15 @@ cache:
(default): Install non-duplicated in top-level, and duplicated as necessary
within directory structure. nested: (formerly --legacy-bundling) install in
place, no hoisting. shallow (formerly --global-style) only install direct
deps at top-level. linked: (experimental) install in node_modules/.store,
link in place, unhoisted.</p>
deps at top-level. linked: install in node_modules/.store, link in place,
unhoisted.</p>
<p>We recommend that package authors use <code>--install-strategy=linked</code> during
development to catch undeclared ("phantom") dependencies before publishing:
the isolated layout only exposes a package's declared dependencies, so an
<code>import</code> of a package that was never added to <code>package.json</code> can fail
instead of resolving by accident and shipping broken. See <a href="../using-npm/developers#catching-undeclared-phantom-dependencies.html">Catching
undeclared ("phantom")
dependencies</a>.</p>
<h4 id="legacy-bundling"><code>legacy-bundling</code></h4>
<ul>
<li>Default: false</li>
@@ -419,6 +426,9 @@ the install instead of running with a notice.</p>
silently skipped; this setting only affects unreviewed entries.
<code>--ignore-scripts</code> and <code>--dangerously-allow-all-scripts</code> both override this
setting.</p>
<p>Optional dependencies that cannot be installed on the current platform or
engine (a non-matching <code>os</code>, <code>cpu</code>, or <code>libc</code>) are not flagged, because
their install scripts never run.</p>
<h4 id="dangerously-allow-all-scripts"><code>dangerously-allow-all-scripts</code></h4>
<ul>
<li>Default: false</li>
+2 -2
View File
@@ -186,9 +186,9 @@ npm command-line interface
<section id="content">
<header class="title">
<h1 id="----npm-completion----11170">
<h1 id="----npm-completion----11180">
<span>npm-completion</span>
<span class="version">@11.17.0</span>
<span class="version">@11.18.0</span>
</h1>
<span class="description">Tab Completion for npm</span>
</header>
+2 -2
View File
@@ -186,9 +186,9 @@ npm command-line interface
<section id="content">
<header class="title">
<h1 id="----npm-config----11170">
<h1 id="----npm-config----11180">
<span>npm-config</span>
<span class="version">@11.17.0</span>
<span class="version">@11.18.0</span>
</h1>
<span class="description">Manage the npm configuration files</span>
</header>
+11 -4
View File
@@ -186,9 +186,9 @@ npm command-line interface
<section id="content">
<header class="title">
<h1 id="----npm-dedupe----11170">
<h1 id="----npm-dedupe----11180">
<span>npm-dedupe</span>
<span class="version">@11.17.0</span>
<span class="version">@11.18.0</span>
</h1>
<span class="description">Reduce duplication in the package tree</span>
</header>
@@ -245,8 +245,15 @@ Dedupe always acts on the entire tree.</p>
(default): Install non-duplicated in top-level, and duplicated as necessary
within directory structure. nested: (formerly --legacy-bundling) install in
place, no hoisting. shallow (formerly --global-style) only install direct
deps at top-level. linked: (experimental) install in node_modules/.store,
link in place, unhoisted.</p>
deps at top-level. linked: install in node_modules/.store, link in place,
unhoisted.</p>
<p>We recommend that package authors use <code>--install-strategy=linked</code> during
development to catch undeclared ("phantom") dependencies before publishing:
the isolated layout only exposes a package's declared dependencies, so an
<code>import</code> of a package that was never added to <code>package.json</code> can fail
instead of resolving by accident and shipping broken. See <a href="../using-npm/developers#catching-undeclared-phantom-dependencies.html">Catching
undeclared ("phantom")
dependencies</a>.</p>
<h4 id="legacy-bundling"><code>legacy-bundling</code></h4>
<ul>
<li>Default: false</li>
+2 -2
View File
@@ -186,9 +186,9 @@ npm command-line interface
<section id="content">
<header class="title">
<h1 id="----npm-deny-scripts----11170">
<h1 id="----npm-deny-scripts----11180">
<span>npm-deny-scripts</span>
<span class="version">@11.17.0</span>
<span class="version">@11.18.0</span>
</h1>
<span class="description">Deny install scripts for specific dependencies</span>
</header>
+2 -2
View File
@@ -186,9 +186,9 @@ npm command-line interface
<section id="content">
<header class="title">
<h1 id="----npm-deprecate----11170">
<h1 id="----npm-deprecate----11180">
<span>npm-deprecate</span>
<span class="version">@11.17.0</span>
<span class="version">@11.18.0</span>
</h1>
<span class="description">Deprecate a version of a package</span>
</header>
+2 -2
View File
@@ -186,9 +186,9 @@ npm command-line interface
<section id="content">
<header class="title">
<h1 id="----npm-diff----11170">
<h1 id="----npm-diff----11180">
<span>npm-diff</span>
<span class="version">@11.17.0</span>
<span class="version">@11.18.0</span>
</h1>
<span class="description">The registry diff command</span>
</header>
+2 -2
View File
@@ -186,9 +186,9 @@ npm command-line interface
<section id="content">
<header class="title">
<h1 id="----npm-dist-tag----11170">
<h1 id="----npm-dist-tag----11180">
<span>npm-dist-tag</span>
<span class="version">@11.17.0</span>
<span class="version">@11.18.0</span>
</h1>
<span class="description">Modify package distribution tags</span>
</header>
+2 -2
View File
@@ -186,9 +186,9 @@ npm command-line interface
<section id="content">
<header class="title">
<h1 id="----npm-docs----11170">
<h1 id="----npm-docs----11180">
<span>npm-docs</span>
<span class="version">@11.17.0</span>
<span class="version">@11.18.0</span>
</h1>
<span class="description">Open documentation for a package in a web browser</span>
</header>
+2 -2
View File
@@ -186,9 +186,9 @@ npm command-line interface
<section id="content">
<header class="title">
<h1 id="----npm-doctor----11170">
<h1 id="----npm-doctor----11180">
<span>npm-doctor</span>
<span class="version">@11.17.0</span>
<span class="version">@11.18.0</span>
</h1>
<span class="description">Check the health of your npm environment</span>
</header>
+2 -2
View File
@@ -186,9 +186,9 @@ npm command-line interface
<section id="content">
<header class="title">
<h1 id="----npm-edit----11170">
<h1 id="----npm-edit----11180">
<span>npm-edit</span>
<span class="version">@11.17.0</span>
<span class="version">@11.18.0</span>
</h1>
<span class="description">Edit an installed package</span>
</header>
+5 -2
View File
@@ -186,9 +186,9 @@ npm command-line interface
<section id="content">
<header class="title">
<h1 id="----npm-exec----11170">
<h1 id="----npm-exec----11180">
<span>npm-exec</span>
<span class="version">@11.17.0</span>
<span class="version">@11.18.0</span>
</h1>
<span class="description">Run a command from a local or remote npm package</span>
</header>
@@ -336,6 +336,9 @@ the install instead of running with a notice.</p>
silently skipped; this setting only affects unreviewed entries.
<code>--ignore-scripts</code> and <code>--dangerously-allow-all-scripts</code> both override this
setting.</p>
<p>Optional dependencies that cannot be installed on the current platform or
engine (a non-matching <code>os</code>, <code>cpu</code>, or <code>libc</code>) are not flagged, because
their install scripts never run.</p>
<h4 id="dangerously-allow-all-scripts"><code>dangerously-allow-all-scripts</code></h4>
<ul>
<li>Default: false</li>
+2 -2
View File
@@ -186,9 +186,9 @@ npm command-line interface
<section id="content">
<header class="title">
<h1 id="----npm-explain----11170">
<h1 id="----npm-explain----11180">
<span>npm-explain</span>
<span class="version">@11.17.0</span>
<span class="version">@11.18.0</span>
</h1>
<span class="description">Explain installed packages</span>
</header>
+2 -2
View File
@@ -186,9 +186,9 @@ npm command-line interface
<section id="content">
<header class="title">
<h1 id="----npm-explore----11170">
<h1 id="----npm-explore----11180">
<span>npm-explore</span>
<span class="version">@11.17.0</span>
<span class="version">@11.18.0</span>
</h1>
<span class="description">Browse an installed package</span>
</header>
+11 -4
View File
@@ -186,9 +186,9 @@ npm command-line interface
<section id="content">
<header class="title">
<h1 id="----npm-find-dupes----11170">
<h1 id="----npm-find-dupes----11180">
<span>npm-find-dupes</span>
<span class="version">@11.17.0</span>
<span class="version">@11.18.0</span>
</h1>
<span class="description">Find duplication in the package tree</span>
</header>
@@ -213,8 +213,15 @@ npm command-line interface
(default): Install non-duplicated in top-level, and duplicated as necessary
within directory structure. nested: (formerly --legacy-bundling) install in
place, no hoisting. shallow (formerly --global-style) only install direct
deps at top-level. linked: (experimental) install in node_modules/.store,
link in place, unhoisted.</p>
deps at top-level. linked: install in node_modules/.store, link in place,
unhoisted.</p>
<p>We recommend that package authors use <code>--install-strategy=linked</code> during
development to catch undeclared ("phantom") dependencies before publishing:
the isolated layout only exposes a package's declared dependencies, so an
<code>import</code> of a package that was never added to <code>package.json</code> can fail
instead of resolving by accident and shipping broken. See <a href="../using-npm/developers#catching-undeclared-phantom-dependencies.html">Catching
undeclared ("phantom")
dependencies</a>.</p>
<h4 id="legacy-bundling"><code>legacy-bundling</code></h4>
<ul>
<li>Default: false</li>
+2 -2
View File
@@ -186,9 +186,9 @@ npm command-line interface
<section id="content">
<header class="title">
<h1 id="----npm-fund----11170">
<h1 id="----npm-fund----11180">
<span>npm-fund</span>
<span class="version">@11.17.0</span>
<span class="version">@11.18.0</span>
</h1>
<span class="description">Retrieve funding information</span>
</header>
+2 -2
View File
@@ -186,9 +186,9 @@ npm command-line interface
<section id="content">
<header class="title">
<h1 id="----npm-get----11170">
<h1 id="----npm-get----11180">
<span>npm-get</span>
<span class="version">@11.17.0</span>
<span class="version">@11.18.0</span>
</h1>
<span class="description">Get a value from the npm configuration</span>
</header>
+2 -2
View File
@@ -186,9 +186,9 @@ npm command-line interface
<section id="content">
<header class="title">
<h1 id="----npm-help-search----11170">
<h1 id="----npm-help-search----11180">
<span>npm-help-search</span>
<span class="version">@11.17.0</span>
<span class="version">@11.18.0</span>
</h1>
<span class="description">Search npm help documentation</span>
</header>
+2 -2
View File
@@ -186,9 +186,9 @@ npm command-line interface
<section id="content">
<header class="title">
<h1 id="----npm-help----11170">
<h1 id="----npm-help----11180">
<span>npm-help</span>
<span class="version">@11.17.0</span>
<span class="version">@11.18.0</span>
</h1>
<span class="description">Get help on npm</span>
</header>
+2 -2
View File
@@ -186,9 +186,9 @@ npm command-line interface
<section id="content">
<header class="title">
<h1 id="----npm-init----11170">
<h1 id="----npm-init----11180">
<span>npm-init</span>
<span class="version">@11.17.0</span>
<span class="version">@11.18.0</span>
</h1>
<span class="description">Create a package.json file</span>
</header>
+14 -4
View File
@@ -186,9 +186,9 @@ npm command-line interface
<section id="content">
<header class="title">
<h1 id="----npm-install-ci-test----11170">
<h1 id="----npm-install-ci-test----11180">
<span>npm-install-ci-test</span>
<span class="version">@11.17.0</span>
<span class="version">@11.18.0</span>
</h1>
<span class="description">Install a project with a clean slate and run tests</span>
</header>
@@ -215,8 +215,15 @@ aliases: cit, clean-install-test, sit
(default): Install non-duplicated in top-level, and duplicated as necessary
within directory structure. nested: (formerly --legacy-bundling) install in
place, no hoisting. shallow (formerly --global-style) only install direct
deps at top-level. linked: (experimental) install in node_modules/.store,
link in place, unhoisted.</p>
deps at top-level. linked: install in node_modules/.store, link in place,
unhoisted.</p>
<p>We recommend that package authors use <code>--install-strategy=linked</code> during
development to catch undeclared ("phantom") dependencies before publishing:
the isolated layout only exposes a package's declared dependencies, so an
<code>import</code> of a package that was never added to <code>package.json</code> can fail
instead of resolving by accident and shipping broken. See <a href="../using-npm/developers#catching-undeclared-phantom-dependencies.html">Catching
undeclared ("phantom")
dependencies</a>.</p>
<h4 id="legacy-bundling"><code>legacy-bundling</code></h4>
<ul>
<li>Default: false</li>
@@ -383,6 +390,9 @@ the install instead of running with a notice.</p>
silently skipped; this setting only affects unreviewed entries.
<code>--ignore-scripts</code> and <code>--dangerously-allow-all-scripts</code> both override this
setting.</p>
<p>Optional dependencies that cannot be installed on the current platform or
engine (a non-matching <code>os</code>, <code>cpu</code>, or <code>libc</code>) are not flagged, because
their install scripts never run.</p>
<h4 id="dangerously-allow-all-scripts"><code>dangerously-allow-all-scripts</code></h4>
<ul>
<li>Default: false</li>
+341
View File
@@ -0,0 +1,341 @@
<!DOCTYPE html><html><head>
<meta charset="utf-8">
<title>npm-install-scripts</title>
<style>
body {
background-color: #ffffff;
color: #24292e;
margin: 0;
line-height: 1.5;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
}
#rainbar {
height: 10px;
background-image: linear-gradient(139deg, #fb8817, #ff4b01, #c12127, #e02aff);
}
a {
text-decoration: none;
color: #0366d6;
}
a:hover {
text-decoration: underline;
}
pre {
margin: 1em 0px;
padding: 1em;
border: solid 1px #e1e4e8;
border-radius: 6px;
display: block;
overflow: auto;
white-space: pre;
background-color: #f6f8fa;
color: #393a34;
}
code {
font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace;
font-size: 85%;
padding: 0.2em 0.4em;
background-color: #f6f8fa;
color: #393a34;
}
pre > code {
padding: 0;
background-color: inherit;
color: inherit;
}
h1, h2, h3 {
font-weight: 600;
}
#logobar {
background-color: #333333;
margin: 0 auto;
padding: 1em 4em;
}
#logobar .logo {
float: left;
}
#logobar .title {
font-weight: 600;
color: #dddddd;
float: left;
margin: 5px 0 0 1em;
}
#logobar:after {
content: "";
display: block;
clear: both;
}
#content {
margin: 0 auto;
padding: 0 4em;
}
#table_of_contents > h2 {
font-size: 1.17em;
}
#table_of_contents ul:first-child {
border: solid 1px #e1e4e8;
border-radius: 6px;
padding: 1em;
background-color: #f6f8fa;
color: #393a34;
}
#table_of_contents ul {
list-style-type: none;
padding-left: 1.5em;
}
#table_of_contents li {
font-size: 0.9em;
}
#table_of_contents li a {
color: #000000;
}
header.title {
border-bottom: solid 1px #e1e4e8;
}
header.title > h1 {
margin-bottom: 0.25em;
}
header.title > .description {
display: block;
margin-bottom: 0.5em;
line-height: 1;
}
header.title .version {
font-size: 0.8em;
color: #666666;
}
footer#edit {
border-top: solid 1px #e1e4e8;
margin: 3em 0 4em 0;
padding-top: 2em;
}
table {
width: 100%;
margin: 1em 0;
border-radius: 6px;
border: 1px solid #e1e4e8;
overflow: hidden;
border-collapse: separate;
border-spacing: 0;
}
table thead {
background-color: #f6f8fa;
}
table tbody {
background-color: #ffffff;
}
table th,
table td {
padding: 0.75em;
text-align: left;
border-right: 1px solid #e1e4e8;
border-bottom: 1px solid #e1e4e8;
}
table th:last-child,
table td:last-child {
border-right: none;
}
table tbody tr:last-child td {
border-bottom: none;
}
table th {
font-weight: 600;
background-color: #f6f8fa;
}
table code {
white-space: nowrap;
}
</style>
</head>
<body>
<div id="banner">
<div id="rainbar"></div>
<div id="logobar">
<svg class="logo" role="img" height="32" width="32" viewBox="0 0 700 700">
<polygon fill="#cb0000" points="0,700 700,700 700,0 0,0"></polygon>
<polygon fill="#ffffff" points="150,550 350,550 350,250 450,250 450,550 550,550 550,150 150,150"></polygon>
</svg>
<div class="title">
npm command-line interface
</div>
</div>
</div>
<section id="content">
<header class="title">
<h1 id="----npm-install-scripts----11180">
<span>npm-install-scripts</span>
<span class="version">@11.18.0</span>
</h1>
<span class="description">Manage install-script approvals for dependencies</span>
</header>
<section id="table_of_contents">
<h2 id="table-of-contents">Table of contents</h2>
<div id="_table_of_contents"><ul><li><a href="#synopsis">Synopsis</a></li><li><a href="#description">Description</a></li><li><a href="#examples">Examples</a></li><li><a href="#configuration">Configuration</a></li><ul><li><a href="#all"><code>all</code></a></li><li><a href="#allow-scripts-pin"><code>allow-scripts-pin</code></a></li><li><a href="#dry-run"><code>dry-run</code></a></li><li><a href="#json"><code>json</code></a></li></ul><li><a href="#see-also">See Also</a></li></ul></div>
</section>
<div id="_content"><h3 id="synopsis">Synopsis</h3>
<pre><code class="language-bash">npm install-scripts approve &lt;pkg&gt; [&lt;pkg&gt; ...]
npm install-scripts approve --all
npm install-scripts deny &lt;pkg&gt; [&lt;pkg&gt; ...]
npm install-scripts deny --all
npm install-scripts ls
npm install-scripts prune
</code></pre>
<p>Note: This command is unaware of workspaces.</p>
<h3 id="description">Description</h3>
<p>Manages the <code>allowScripts</code> field in your project's <code>package.json</code>, which
records which of your dependencies are permitted to run install scripts
(<code>preinstall</code>, <code>install</code>, <code>postinstall</code>, and <code>prepare</code> for non-registry
sources). This is the recommended way to maintain that field.</p>
<p>Dependency install scripts are blocked by default. Install commands
silently skip lifecycle scripts for any dependency that does not have a
matching entry in <code>allowScripts</code>, and end with a list of the packages
whose scripts were skipped so you can review them here.</p>
<p>This command only works inside a project that has a <code>package.json</code>. Running
it with <code>--global</code> (<code>-g</code>) fails with an <code>EGLOBAL</code> error, since global
installs (<code>npm install -g</code>) and one-off executions (<code>npm exec</code> / <code>npx</code>) have
no project <code>package.json</code> to write to. To allow install scripts in those
contexts, use the <code>--allow-scripts</code> flag at install time (for example
<code>npm install -g --allow-scripts=canvas,sharp</code>) or persist the setting with
<code>npm config set allow-scripts=canvas,sharp --location=user</code>.</p>
<p>There are four subcommands:</p>
<pre><code class="language-bash">npm install-scripts approve &lt;pkg&gt; [&lt;pkg&gt; ...]
npm install-scripts approve --all
npm install-scripts deny &lt;pkg&gt; [&lt;pkg&gt; ...]
npm install-scripts deny --all
npm install-scripts ls
npm install-scripts prune
</code></pre>
<p><code>approve</code> allows install scripts for the named packages. <code>&lt;pkg&gt;</code> matches
every installed version of that package. By default it writes pinned entries
(<code>pkg@1.2.3</code>), which keep their approval narrowed to the specific version you
reviewed. Pass <code>--no-allow-scripts-pin</code> to write name-only entries that allow
any future version. <code>--all</code> approves every package with unreviewed install
scripts in one go.</p>
<p><code>deny</code> records an explicit denial for the named packages (a name-only <code>false</code>
entry), which survives <code>npm install-scripts approve --all</code> and excludes the
package from any future blanket approval. <code>--all</code> denies every package with
unreviewed install scripts.</p>
<p><code>ls</code> is read-only: it lists every package whose install scripts are not yet
covered by <code>allowScripts</code>, without modifying <code>package.json</code>.</p>
<p><code>prune</code> removes <code>allowScripts</code> entries that no longer match an installed
package with an install script, either because the package is no longer
installed (a transitive dependency changed, or a pinned <code>pkg@1.2.3</code> was
upgraded) or because it no longer has an install script. Both approvals
(<code>true</code>) and denials (<code>false</code>) are removed. It edits only the <code>allowScripts</code>
field in <code>package.json</code>, never <code>.npmrc</code> or <code>--allow-scripts</code>. Pass <code>--dry-run</code>
to preview without writing. Unparseable keys are left alone.</p>
<p><code>approve</code> honours the asymmetric pin rule: if you re-approve a package whose
installed version has changed, the existing pin is rewritten to track the new
installed version. Multi-version statements (<code>pkg@1 || 2</code>) are left alone,
since they likely capture intent that the command cannot infer. Existing
<code>false</code> entries always win; <code>approve</code> will not silently re-allow a package you
previously denied.</p>
<p>The standalone commands <a href="../commands/npm-approve-scripts.html"><code>npm approve-scripts</code></a>
and <a href="../commands/npm-deny-scripts.html"><code>npm deny-scripts</code></a> are aliases for
<code>npm install-scripts approve</code> and <code>npm install-scripts deny</code>.</p>
<h3 id="examples">Examples</h3>
<pre><code class="language-bash"># Approve all currently-installed install scripts after reviewing them
npm install-scripts approve --all
# Approve specific packages, pinned to their installed version
npm install-scripts approve canvas sharp
# Deny a package so it stays blocked
npm install-scripts deny telemetry-pkg
# Preview which packages still need review
npm install-scripts ls
# Preview stale allowScripts entries, then remove them
npm install-scripts prune --dry-run
npm install-scripts prune
</code></pre>
<h3 id="configuration">Configuration</h3>
<h4 id="all"><code>all</code></h4>
<ul>
<li>Default: false</li>
<li>Type: Boolean</li>
</ul>
<p>Show or act on all packages, not just the ones your project directly depends
on. For <code>npm outdated</code> and <code>npm ls</code> this lists every outdated or installed
package. For <code>npm approve-scripts</code> and <code>npm deny-scripts</code> it selects every
package with pending install scripts.</p>
<h4 id="allow-scripts-pin"><code>allow-scripts-pin</code></h4>
<ul>
<li>Default: true</li>
<li>Type: Boolean</li>
</ul>
<p>Write pinned (<code>pkg@version</code>) entries when approving install scripts. Set to
<code>false</code> to write name-only entries that allow any version. Has no effect on
<code>npm deny-scripts</code>, which always writes name-only entries regardless of this
setting.</p>
<h4 id="dry-run"><code>dry-run</code></h4>
<ul>
<li>Default: false</li>
<li>Type: Boolean</li>
</ul>
<p>Indicates that you don't want npm to make any changes and that it should
only report what it would have done. This can be passed into any of the
commands that modify your local installation, eg, <code>install</code>, <code>update</code>,
<code>dedupe</code>, <code>uninstall</code>, as well as <code>pack</code> and <code>publish</code>.</p>
<p>Note: This is NOT honored by other network related commands, eg <code>dist-tags</code>,
<code>owner</code>, etc.</p>
<h4 id="json"><code>json</code></h4>
<ul>
<li>Default: false</li>
<li>Type: Boolean</li>
</ul>
<p>Whether or not to output JSON data, rather than the normal output.</p>
<ul>
<li>In <code>npm pkg set</code> it enables parsing set values with JSON.parse() before
saving them to your <code>package.json</code>.</li>
</ul>
<p>Not supported by all npm commands.</p>
<h3 id="see-also">See Also</h3>
<ul>
<li><a href="../commands/npm-approve-scripts.html">npm approve-scripts</a></li>
<li><a href="../commands/npm-deny-scripts.html">npm deny-scripts</a></li>
<li><a href="../commands/npm-install.html">npm install</a></li>
<li><a href="../commands/npm-rebuild.html">npm rebuild</a></li>
<li><a href="../configuring-npm/package-json.html">package.json</a></li>
</ul></div>
<footer id="edit">
<a href="https://github.com/npm/cli/edit/latest/docs/lib/content/commands/npm-install-scripts.md">
<svg role="img" viewBox="0 0 16 16" width="16" height="16" fill="currentcolor" style="vertical-align: text-bottom; margin-right: 0.3em;">
<path fill-rule="evenodd" d="M11.013 1.427a1.75 1.75 0 012.474 0l1.086 1.086a1.75 1.75 0 010 2.474l-8.61 8.61c-.21.21-.47.364-.756.445l-3.251.93a.75.75 0 01-.927-.928l.929-3.25a1.75 1.75 0 01.445-.758l8.61-8.61zm1.414 1.06a.25.25 0 00-.354 0L10.811 3.75l1.439 1.44 1.263-1.263a.25.25 0 000-.354l-1.086-1.086zM11.189 6.25L9.75 4.81l-6.286 6.287a.25.25 0 00-.064.108l-.558 1.953 1.953-.558a.249.249 0 00.108-.064l6.286-6.286z"></path>
</svg>
Edit this page on GitHub
</a>
</footer>
</section>
</body></html>
+21 -4
View File
@@ -186,9 +186,9 @@ npm command-line interface
<section id="content">
<header class="title">
<h1 id="----npm-install-test----11170">
<h1 id="----npm-install-test----11180">
<span>npm-install-test</span>
<span class="version">@11.17.0</span>
<span class="version">@11.18.0</span>
</h1>
<span class="description">Install package(s) and run tests</span>
</header>
@@ -246,8 +246,15 @@ of the current working directory.</li>
(default): Install non-duplicated in top-level, and duplicated as necessary
within directory structure. nested: (formerly --legacy-bundling) install in
place, no hoisting. shallow (formerly --global-style) only install direct
deps at top-level. linked: (experimental) install in node_modules/.store,
link in place, unhoisted.</p>
deps at top-level. linked: install in node_modules/.store, link in place,
unhoisted.</p>
<p>We recommend that package authors use <code>--install-strategy=linked</code> during
development to catch undeclared ("phantom") dependencies before publishing:
the isolated layout only exposes a package's declared dependencies, so an
<code>import</code> of a package that was never added to <code>package.json</code> can fail
instead of resolving by accident and shipping broken. See <a href="../using-npm/developers#catching-undeclared-phantom-dependencies.html">Catching
undeclared ("phantom")
dependencies</a>.</p>
<h4 id="legacy-bundling"><code>legacy-bundling</code></h4>
<ul>
<li>Default: false</li>
@@ -439,6 +446,9 @@ the install instead of running with a notice.</p>
silently skipped; this setting only affects unreviewed entries.
<code>--ignore-scripts</code> and <code>--dangerously-allow-all-scripts</code> both override this
setting.</p>
<p>Optional dependencies that cannot be installed on the current platform or
engine (a non-matching <code>os</code>, <code>cpu</code>, or <code>libc</code>) are not flagged, because
their install scripts never run.</p>
<h4 id="dangerously-allow-all-scripts"><code>dangerously-allow-all-scripts</code></h4>
<ul>
<li>Default: false</li>
@@ -475,6 +485,8 @@ wins (an explicit absolute date overrides a relative window). Across
sources, the standard precedence applies (cli &gt; env &gt; project &gt; user &gt;
global), so a higher-priority source can always relax or override a
lower-priority one.</p>
<p>As with <code>min-release-age</code>, when this cutoff blocks a fix that <code>npm audit fix</code> would install, npm keeps the vulnerable version, warns, and exits with
a non-zero code.</p>
<p>Packages whose names match <code>min-release-age-exclude</code> are exempt from this
filter.</p>
<h4 id="min-release-age"><code>min-release-age</code></h4>
@@ -492,6 +504,11 @@ your <code>.npmrc</code> is preserved when npm internally spawns a sub-process w
<code>--before</code> while preparing a <code>git:</code> or <code>github:</code> dependency); when both
apply, <code>before</code> wins within a single source and across sources the standard
precedence rules apply.</p>
<p>When this window stops <code>npm audit fix</code> from installing a patched version
(because the fix was published too recently), npm keeps the package at its
vulnerable version, warns that the fix was blocked, and exits with a
non-zero code. To install the fix, add the package to
<code>min-release-age-exclude</code>, or relax <code>min-release-age</code> or <code>before</code>.</p>
<p>Packages whose names match <code>min-release-age-exclude</code> are exempt from this
filter.</p>
<p>This value is not exported to the environment for child processes.</p>
+21 -4
View File
@@ -186,9 +186,9 @@ npm command-line interface
<section id="content">
<header class="title">
<h1 id="----npm-install----11170">
<h1 id="----npm-install----11180">
<span>npm-install</span>
<span class="version">@11.17.0</span>
<span class="version">@11.18.0</span>
</h1>
<span class="description">Install a package</span>
</header>
@@ -521,8 +521,15 @@ of the current working directory.</li>
(default): Install non-duplicated in top-level, and duplicated as necessary
within directory structure. nested: (formerly --legacy-bundling) install in
place, no hoisting. shallow (formerly --global-style) only install direct
deps at top-level. linked: (experimental) install in node_modules/.store,
link in place, unhoisted.</p>
deps at top-level. linked: install in node_modules/.store, link in place,
unhoisted.</p>
<p>We recommend that package authors use <code>--install-strategy=linked</code> during
development to catch undeclared ("phantom") dependencies before publishing:
the isolated layout only exposes a package's declared dependencies, so an
<code>import</code> of a package that was never added to <code>package.json</code> can fail
instead of resolving by accident and shipping broken. See <a href="../using-npm/developers#catching-undeclared-phantom-dependencies.html">Catching
undeclared ("phantom")
dependencies</a>.</p>
<h4 id="legacy-bundling"><code>legacy-bundling</code></h4>
<ul>
<li>Default: false</li>
@@ -714,6 +721,9 @@ the install instead of running with a notice.</p>
silently skipped; this setting only affects unreviewed entries.
<code>--ignore-scripts</code> and <code>--dangerously-allow-all-scripts</code> both override this
setting.</p>
<p>Optional dependencies that cannot be installed on the current platform or
engine (a non-matching <code>os</code>, <code>cpu</code>, or <code>libc</code>) are not flagged, because
their install scripts never run.</p>
<h4 id="dangerously-allow-all-scripts"><code>dangerously-allow-all-scripts</code></h4>
<ul>
<li>Default: false</li>
@@ -750,6 +760,8 @@ wins (an explicit absolute date overrides a relative window). Across
sources, the standard precedence applies (cli &gt; env &gt; project &gt; user &gt;
global), so a higher-priority source can always relax or override a
lower-priority one.</p>
<p>As with <code>min-release-age</code>, when this cutoff blocks a fix that <code>npm audit fix</code> would install, npm keeps the vulnerable version, warns, and exits with
a non-zero code.</p>
<p>Packages whose names match <code>min-release-age-exclude</code> are exempt from this
filter.</p>
<h4 id="min-release-age"><code>min-release-age</code></h4>
@@ -767,6 +779,11 @@ your <code>.npmrc</code> is preserved when npm internally spawns a sub-process w
<code>--before</code> while preparing a <code>git:</code> or <code>github:</code> dependency); when both
apply, <code>before</code> wins within a single source and across sources the standard
precedence rules apply.</p>
<p>When this window stops <code>npm audit fix</code> from installing a patched version
(because the fix was published too recently), npm keeps the package at its
vulnerable version, warns that the fix was blocked, and exits with a
non-zero code. To install the fix, add the package to
<code>min-release-age-exclude</code>, or relax <code>min-release-age</code> or <code>before</code>.</p>
<p>Packages whose names match <code>min-release-age-exclude</code> are exempt from this
filter.</p>
<p>This value is not exported to the environment for child processes.</p>
+11 -4
View File
@@ -186,9 +186,9 @@ npm command-line interface
<section id="content">
<header class="title">
<h1 id="----npm-link----11170">
<h1 id="----npm-link----11180">
<span>npm-link</span>
<span class="version">@11.17.0</span>
<span class="version">@11.18.0</span>
</h1>
<span class="description">Symlink a package folder</span>
</header>
@@ -288,8 +288,15 @@ of the current working directory.</li>
(default): Install non-duplicated in top-level, and duplicated as necessary
within directory structure. nested: (formerly --legacy-bundling) install in
place, no hoisting. shallow (formerly --global-style) only install direct
deps at top-level. linked: (experimental) install in node_modules/.store,
link in place, unhoisted.</p>
deps at top-level. linked: install in node_modules/.store, link in place,
unhoisted.</p>
<p>We recommend that package authors use <code>--install-strategy=linked</code> during
development to catch undeclared ("phantom") dependencies before publishing:
the isolated layout only exposes a package's declared dependencies, so an
<code>import</code> of a package that was never added to <code>package.json</code> can fail
instead of resolving by accident and shipping broken. See <a href="../using-npm/developers#catching-undeclared-phantom-dependencies.html">Catching
undeclared ("phantom")
dependencies</a>.</p>
<h4 id="legacy-bundling"><code>legacy-bundling</code></h4>
<ul>
<li>Default: false</li>
+2 -2
View File
@@ -186,9 +186,9 @@ npm command-line interface
<section id="content">
<header class="title">
<h1 id="----npm-ll----11170">
<h1 id="----npm-ll----11180">
<span>npm-ll</span>
<span class="version">@11.17.0</span>
<span class="version">@11.18.0</span>
</h1>
<span class="description">List installed packages</span>
</header>
+2 -2
View File
@@ -186,9 +186,9 @@ npm command-line interface
<section id="content">
<header class="title">
<h1 id="----npm-login----11170">
<h1 id="----npm-login----11180">
<span>npm-login</span>
<span class="version">@11.17.0</span>
<span class="version">@11.18.0</span>
</h1>
<span class="description">Login to a registry user account</span>
</header>
+2 -2
View File
@@ -186,9 +186,9 @@ npm command-line interface
<section id="content">
<header class="title">
<h1 id="----npm-logout----11170">
<h1 id="----npm-logout----11180">
<span>npm-logout</span>
<span class="version">@11.17.0</span>
<span class="version">@11.18.0</span>
</h1>
<span class="description">Log out of the registry</span>
</header>
+3 -3
View File
@@ -186,9 +186,9 @@ npm command-line interface
<section id="content">
<header class="title">
<h1 id="----npm-ls----11170">
<h1 id="----npm-ls----11180">
<span>npm-ls</span>
<span class="version">@11.17.0</span>
<span class="version">@11.18.0</span>
</h1>
<span class="description">List installed packages</span>
</header>
@@ -209,7 +209,7 @@ alias: list
<p>Positional arguments are <code>name@version-range</code> identifiers, which will limit the results to only the paths to the packages named.
Note that nested packages will <em>also</em> show the paths to the specified packages.
For example, running <code>npm ls promzard</code> in npm's source tree will show:</p>
<pre><code class="language-bash">npm@11.17.0 /path/to/npm
<pre><code class="language-bash">npm@11.18.0 /path/to/npm
└─┬ init-package-json@0.0.4
└── promzard@0.1.5
</code></pre>
+2 -2
View File
@@ -186,9 +186,9 @@ npm command-line interface
<section id="content">
<header class="title">
<h1 id="----npm-org----11170">
<h1 id="----npm-org----11180">
<span>npm-org</span>
<span class="version">@11.17.0</span>
<span class="version">@11.18.0</span>
</h1>
<span class="description">Manage orgs</span>
</header>
+9 -2
View File
@@ -186,9 +186,9 @@ npm command-line interface
<section id="content">
<header class="title">
<h1 id="----npm-outdated----11170">
<h1 id="----npm-outdated----11180">
<span>npm-outdated</span>
<span class="version">@11.17.0</span>
<span class="version">@11.18.0</span>
</h1>
<span class="description">Check for outdated packages</span>
</header>
@@ -334,6 +334,8 @@ wins (an explicit absolute date overrides a relative window). Across
sources, the standard precedence applies (cli &gt; env &gt; project &gt; user &gt;
global), so a higher-priority source can always relax or override a
lower-priority one.</p>
<p>As with <code>min-release-age</code>, when this cutoff blocks a fix that <code>npm audit fix</code> would install, npm keeps the vulnerable version, warns, and exits with
a non-zero code.</p>
<p>Packages whose names match <code>min-release-age-exclude</code> are exempt from this
filter.</p>
<h4 id="min-release-age"><code>min-release-age</code></h4>
@@ -351,6 +353,11 @@ your <code>.npmrc</code> is preserved when npm internally spawns a sub-process w
<code>--before</code> while preparing a <code>git:</code> or <code>github:</code> dependency); when both
apply, <code>before</code> wins within a single source and across sources the standard
precedence rules apply.</p>
<p>When this window stops <code>npm audit fix</code> from installing a patched version
(because the fix was published too recently), npm keeps the package at its
vulnerable version, warns that the fix was blocked, and exits with a
non-zero code. To install the fix, add the package to
<code>min-release-age-exclude</code>, or relax <code>min-release-age</code> or <code>before</code>.</p>
<p>Packages whose names match <code>min-release-age-exclude</code> are exempt from this
filter.</p>
<p>This value is not exported to the environment for child processes.</p>
+2 -2
View File
@@ -186,9 +186,9 @@ npm command-line interface
<section id="content">
<header class="title">
<h1 id="----npm-owner----11170">
<h1 id="----npm-owner----11180">
<span>npm-owner</span>
<span class="version">@11.17.0</span>
<span class="version">@11.18.0</span>
</h1>
<span class="description">Manage package owners</span>
</header>
+2 -2
View File
@@ -186,9 +186,9 @@ npm command-line interface
<section id="content">
<header class="title">
<h1 id="----npm-pack----11170">
<h1 id="----npm-pack----11180">
<span>npm-pack</span>
<span class="version">@11.17.0</span>
<span class="version">@11.18.0</span>
</h1>
<span class="description">Create a tarball from a package</span>
</header>
+2 -2
View File
@@ -186,9 +186,9 @@ npm command-line interface
<section id="content">
<header class="title">
<h1 id="----npm-ping----11170">
<h1 id="----npm-ping----11180">
<span>npm-ping</span>
<span class="version">@11.17.0</span>
<span class="version">@11.18.0</span>
</h1>
<span class="description">Ping npm registry</span>
</header>
+2 -2
View File
@@ -186,9 +186,9 @@ npm command-line interface
<section id="content">
<header class="title">
<h1 id="----npm-pkg----11170">
<h1 id="----npm-pkg----11180">
<span>npm-pkg</span>
<span class="version">@11.17.0</span>
<span class="version">@11.18.0</span>
</h1>
<span class="description">Manages your package.json</span>
</header>
+2 -2
View File
@@ -186,9 +186,9 @@ npm command-line interface
<section id="content">
<header class="title">
<h1 id="----npm-prefix----11170">
<h1 id="----npm-prefix----11180">
<span>npm-prefix</span>
<span class="version">@11.17.0</span>
<span class="version">@11.18.0</span>
</h1>
<span class="description">Display prefix</span>
</header>
+2 -2
View File
@@ -186,9 +186,9 @@ npm command-line interface
<section id="content">
<header class="title">
<h1 id="----npm-profile----11170">
<h1 id="----npm-profile----11180">
<span>npm-profile</span>
<span class="version">@11.17.0</span>
<span class="version">@11.18.0</span>
</h1>
<span class="description">Change settings on your registry profile</span>
</header>
+2 -2
View File
@@ -186,9 +186,9 @@ npm command-line interface
<section id="content">
<header class="title">
<h1 id="----npm-prune----11170">
<h1 id="----npm-prune----11180">
<span>npm-prune</span>
<span class="version">@11.17.0</span>
<span class="version">@11.18.0</span>
</h1>
<span class="description">Remove extraneous packages</span>
</header>
+2 -2
View File
@@ -186,9 +186,9 @@ npm command-line interface
<section id="content">
<header class="title">
<h1 id="----npm-publish----11170">
<h1 id="----npm-publish----11180">
<span>npm-publish</span>
<span class="version">@11.17.0</span>
<span class="version">@11.18.0</span>
</h1>
<span class="description">Publish a package</span>
</header>
+9 -2
View File
@@ -186,9 +186,9 @@ npm command-line interface
<section id="content">
<header class="title">
<h1 id="----npm-query----11170">
<h1 id="----npm-query----11180">
<span>npm-query</span>
<span class="version">@11.17.0</span>
<span class="version">@11.18.0</span>
</h1>
<span class="description">Dependency selector query</span>
</header>
@@ -432,6 +432,8 @@ wins (an explicit absolute date overrides a relative window). Across
sources, the standard precedence applies (cli &gt; env &gt; project &gt; user &gt;
global), so a higher-priority source can always relax or override a
lower-priority one.</p>
<p>As with <code>min-release-age</code>, when this cutoff blocks a fix that <code>npm audit fix</code> would install, npm keeps the vulnerable version, warns, and exits with
a non-zero code.</p>
<p>Packages whose names match <code>min-release-age-exclude</code> are exempt from this
filter.</p>
<h4 id="min-release-age"><code>min-release-age</code></h4>
@@ -449,6 +451,11 @@ your <code>.npmrc</code> is preserved when npm internally spawns a sub-process w
<code>--before</code> while preparing a <code>git:</code> or <code>github:</code> dependency); when both
apply, <code>before</code> wins within a single source and across sources the standard
precedence rules apply.</p>
<p>When this window stops <code>npm audit fix</code> from installing a patched version
(because the fix was published too recently), npm keeps the package at its
vulnerable version, warns that the fix was blocked, and exits with a
non-zero code. To install the fix, add the package to
<code>min-release-age-exclude</code>, or relax <code>min-release-age</code> or <code>before</code>.</p>
<p>Packages whose names match <code>min-release-age-exclude</code> are exempt from this
filter.</p>
<p>This value is not exported to the environment for child processes.</p>
+5 -2
View File
@@ -186,9 +186,9 @@ npm command-line interface
<section id="content">
<header class="title">
<h1 id="----npm-rebuild----11170">
<h1 id="----npm-rebuild----11180">
<span>npm-rebuild</span>
<span class="version">@11.17.0</span>
<span class="version">@11.18.0</span>
</h1>
<span class="description">Rebuild a package</span>
</header>
@@ -298,6 +298,9 @@ the install instead of running with a notice.</p>
silently skipped; this setting only affects unreviewed entries.
<code>--ignore-scripts</code> and <code>--dangerously-allow-all-scripts</code> both override this
setting.</p>
<p>Optional dependencies that cannot be installed on the current platform or
engine (a non-matching <code>os</code>, <code>cpu</code>, or <code>libc</code>) are not flagged, because
their install scripts never run.</p>
<h4 id="dangerously-allow-all-scripts"><code>dangerously-allow-all-scripts</code></h4>
<ul>
<li>Default: false</li>
+2 -2
View File
@@ -186,9 +186,9 @@ npm command-line interface
<section id="content">
<header class="title">
<h1 id="----npm-repo----11170">
<h1 id="----npm-repo----11180">
<span>npm-repo</span>
<span class="version">@11.17.0</span>
<span class="version">@11.18.0</span>
</h1>
<span class="description">Open package repository page in the browser</span>
</header>
+2 -2
View File
@@ -186,9 +186,9 @@ npm command-line interface
<section id="content">
<header class="title">
<h1 id="----npm-restart----11170">
<h1 id="----npm-restart----11180">
<span>npm-restart</span>
<span class="version">@11.17.0</span>
<span class="version">@11.18.0</span>
</h1>
<span class="description">Restart a package</span>
</header>
+2 -2
View File
@@ -186,9 +186,9 @@ npm command-line interface
<section id="content">
<header class="title">
<h1 id="----npm-root----11170">
<h1 id="----npm-root----11180">
<span>npm-root</span>
<span class="version">@11.17.0</span>
<span class="version">@11.18.0</span>
</h1>
<span class="description">Display npm root</span>
</header>
+2 -2
View File
@@ -186,9 +186,9 @@ npm command-line interface
<section id="content">
<header class="title">
<h1 id="----npm-run----11170">
<h1 id="----npm-run----11180">
<span>npm-run</span>
<span class="version">@11.17.0</span>
<span class="version">@11.18.0</span>
</h1>
<span class="description">Run arbitrary package scripts</span>
</header>
+2 -2
View File
@@ -186,9 +186,9 @@ npm command-line interface
<section id="content">
<header class="title">
<h1 id="----npm-sbom----11170">
<h1 id="----npm-sbom----11180">
<span>npm-sbom</span>
<span class="version">@11.17.0</span>
<span class="version">@11.18.0</span>
</h1>
<span class="description">Generate a Software Bill of Materials (SBOM)</span>
</header>
+2 -2
View File
@@ -186,9 +186,9 @@ npm command-line interface
<section id="content">
<header class="title">
<h1 id="----npm-search----11170">
<h1 id="----npm-search----11180">
<span>npm-search</span>
<span class="version">@11.17.0</span>
<span class="version">@11.18.0</span>
</h1>
<span class="description">Search for packages</span>
</header>
+2 -2
View File
@@ -186,9 +186,9 @@ npm command-line interface
<section id="content">
<header class="title">
<h1 id="----npm-set----11170">
<h1 id="----npm-set----11180">
<span>npm-set</span>
<span class="version">@11.17.0</span>
<span class="version">@11.18.0</span>
</h1>
<span class="description">Set a value in the npm configuration</span>
</header>
+2 -2
View File
@@ -186,9 +186,9 @@ npm command-line interface
<section id="content">
<header class="title">
<h1 id="----npm-shrinkwrap----11170">
<h1 id="----npm-shrinkwrap----11180">
<span>npm-shrinkwrap</span>
<span class="version">@11.17.0</span>
<span class="version">@11.18.0</span>
</h1>
<span class="description">Lock down dependency versions for publication</span>
</header>
+2 -2
View File
@@ -186,9 +186,9 @@ npm command-line interface
<section id="content">
<header class="title">
<h1 id="----npm-stage----11170">
<h1 id="----npm-stage----11180">
<span>npm-stage</span>
<span class="version">@11.17.0</span>
<span class="version">@11.18.0</span>
</h1>
<span class="description">Stage packages for publishing</span>
</header>
+2 -2
View File
@@ -186,9 +186,9 @@ npm command-line interface
<section id="content">
<header class="title">
<h1 id="----npm-star----11170">
<h1 id="----npm-star----11180">
<span>npm-star</span>
<span class="version">@11.17.0</span>
<span class="version">@11.18.0</span>
</h1>
<span class="description">Mark your favorite packages</span>
</header>
+2 -2
View File
@@ -186,9 +186,9 @@ npm command-line interface
<section id="content">
<header class="title">
<h1 id="----npm-stars----11170">
<h1 id="----npm-stars----11180">
<span>npm-stars</span>
<span class="version">@11.17.0</span>
<span class="version">@11.18.0</span>
</h1>
<span class="description">View packages marked as favorites</span>
</header>
+2 -2
View File
@@ -186,9 +186,9 @@ npm command-line interface
<section id="content">
<header class="title">
<h1 id="----npm-start----11170">
<h1 id="----npm-start----11180">
<span>npm-start</span>
<span class="version">@11.17.0</span>
<span class="version">@11.18.0</span>
</h1>
<span class="description">Start a package</span>
</header>
+2 -2
View File
@@ -186,9 +186,9 @@ npm command-line interface
<section id="content">
<header class="title">
<h1 id="----npm-stop----11170">
<h1 id="----npm-stop----11180">
<span>npm-stop</span>
<span class="version">@11.17.0</span>
<span class="version">@11.18.0</span>
</h1>
<span class="description">Stop a package</span>
</header>
+2 -2
View File
@@ -186,9 +186,9 @@ npm command-line interface
<section id="content">
<header class="title">
<h1 id="----npm-team----11170">
<h1 id="----npm-team----11180">
<span>npm-team</span>
<span class="version">@11.17.0</span>
<span class="version">@11.18.0</span>
</h1>
<span class="description">Manage organization teams and team memberships</span>
</header>
+2 -2
View File
@@ -186,9 +186,9 @@ npm command-line interface
<section id="content">
<header class="title">
<h1 id="----npm-test----11170">
<h1 id="----npm-test----11180">
<span>npm-test</span>
<span class="version">@11.17.0</span>
<span class="version">@11.18.0</span>
</h1>
<span class="description">Test a package</span>
</header>
+2 -2
View File
@@ -186,9 +186,9 @@ npm command-line interface
<section id="content">
<header class="title">
<h1 id="----npm-token----11170">
<h1 id="----npm-token----11180">
<span>npm-token</span>
<span class="version">@11.17.0</span>
<span class="version">@11.18.0</span>
</h1>
<span class="description">Manage your authentication tokens</span>
</header>
+2 -2
View File
@@ -186,9 +186,9 @@ npm command-line interface
<section id="content">
<header class="title">
<h1 id="----npm-trust----11170">
<h1 id="----npm-trust----11180">
<span>npm-trust</span>
<span class="version">@11.17.0</span>
<span class="version">@11.18.0</span>
</h1>
<span class="description">Manage trusted publishing relationships between packages and CI/CD providers</span>
</header>
+2 -2
View File
@@ -186,9 +186,9 @@ npm command-line interface
<section id="content">
<header class="title">
<h1 id="----npm-undeprecate----11170">
<h1 id="----npm-undeprecate----11180">
<span>npm-undeprecate</span>
<span class="version">@11.17.0</span>
<span class="version">@11.18.0</span>
</h1>
<span class="description">Undeprecate a version of a package</span>
</header>
+2 -2
View File
@@ -186,9 +186,9 @@ npm command-line interface
<section id="content">
<header class="title">
<h1 id="----npm-uninstall----11170">
<h1 id="----npm-uninstall----11180">
<span>npm-uninstall</span>
<span class="version">@11.17.0</span>
<span class="version">@11.18.0</span>
</h1>
<span class="description">Remove a package</span>
</header>
+2 -2
View File
@@ -186,9 +186,9 @@ npm command-line interface
<section id="content">
<header class="title">
<h1 id="----npm-unpublish----11170">
<h1 id="----npm-unpublish----11180">
<span>npm-unpublish</span>
<span class="version">@11.17.0</span>
<span class="version">@11.18.0</span>
</h1>
<span class="description">Remove a package from the registry</span>
</header>
+2 -2
View File
@@ -186,9 +186,9 @@ npm command-line interface
<section id="content">
<header class="title">
<h1 id="----npm-unstar----11170">
<h1 id="----npm-unstar----11180">
<span>npm-unstar</span>
<span class="version">@11.17.0</span>
<span class="version">@11.18.0</span>
</h1>
<span class="description">Remove an item from your favorite packages</span>
</header>
+21 -4
View File
@@ -186,9 +186,9 @@ npm command-line interface
<section id="content">
<header class="title">
<h1 id="----npm-update----11170">
<h1 id="----npm-update----11180">
<span>npm-update</span>
<span class="version">@11.17.0</span>
<span class="version">@11.18.0</span>
</h1>
<span class="description">Update packages</span>
</header>
@@ -317,8 +317,15 @@ of the current working directory.</li>
(default): Install non-duplicated in top-level, and duplicated as necessary
within directory structure. nested: (formerly --legacy-bundling) install in
place, no hoisting. shallow (formerly --global-style) only install direct
deps at top-level. linked: (experimental) install in node_modules/.store,
link in place, unhoisted.</p>
deps at top-level. linked: install in node_modules/.store, link in place,
unhoisted.</p>
<p>We recommend that package authors use <code>--install-strategy=linked</code> during
development to catch undeclared ("phantom") dependencies before publishing:
the isolated layout only exposes a package's declared dependencies, so an
<code>import</code> of a package that was never added to <code>package.json</code> can fail
instead of resolving by accident and shipping broken. See <a href="../using-npm/developers#catching-undeclared-phantom-dependencies.html">Catching
undeclared ("phantom")
dependencies</a>.</p>
<h4 id="legacy-bundling"><code>legacy-bundling</code></h4>
<ul>
<li>Default: false</li>
@@ -435,6 +442,9 @@ the install instead of running with a notice.</p>
silently skipped; this setting only affects unreviewed entries.
<code>--ignore-scripts</code> and <code>--dangerously-allow-all-scripts</code> both override this
setting.</p>
<p>Optional dependencies that cannot be installed on the current platform or
engine (a non-matching <code>os</code>, <code>cpu</code>, or <code>libc</code>) are not flagged, because
their install scripts never run.</p>
<h4 id="dangerously-allow-all-scripts"><code>dangerously-allow-all-scripts</code></h4>
<ul>
<li>Default: false</li>
@@ -471,6 +481,8 @@ wins (an explicit absolute date overrides a relative window). Across
sources, the standard precedence applies (cli &gt; env &gt; project &gt; user &gt;
global), so a higher-priority source can always relax or override a
lower-priority one.</p>
<p>As with <code>min-release-age</code>, when this cutoff blocks a fix that <code>npm audit fix</code> would install, npm keeps the vulnerable version, warns, and exits with
a non-zero code.</p>
<p>Packages whose names match <code>min-release-age-exclude</code> are exempt from this
filter.</p>
<h4 id="min-release-age"><code>min-release-age</code></h4>
@@ -488,6 +500,11 @@ your <code>.npmrc</code> is preserved when npm internally spawns a sub-process w
<code>--before</code> while preparing a <code>git:</code> or <code>github:</code> dependency); when both
apply, <code>before</code> wins within a single source and across sources the standard
precedence rules apply.</p>
<p>When this window stops <code>npm audit fix</code> from installing a patched version
(because the fix was published too recently), npm keeps the package at its
vulnerable version, warns that the fix was blocked, and exits with a
non-zero code. To install the fix, add the package to
<code>min-release-age-exclude</code>, or relax <code>min-release-age</code> or <code>before</code>.</p>
<p>Packages whose names match <code>min-release-age-exclude</code> are exempt from this
filter.</p>
<p>This value is not exported to the environment for child processes.</p>
+2 -2
View File
@@ -186,9 +186,9 @@ npm command-line interface
<section id="content">
<header class="title">
<h1 id="----npm-version----11170">
<h1 id="----npm-version----11180">
<span>npm-version</span>
<span class="version">@11.17.0</span>
<span class="version">@11.18.0</span>
</h1>
<span class="description">Bump a package version</span>
</header>
+2 -2
View File
@@ -186,9 +186,9 @@ npm command-line interface
<section id="content">
<header class="title">
<h1 id="----npm-view----11170">
<h1 id="----npm-view----11180">
<span>npm-view</span>
<span class="version">@11.17.0</span>
<span class="version">@11.18.0</span>
</h1>
<span class="description">View registry info</span>
</header>
+2 -2
View File
@@ -186,9 +186,9 @@ npm command-line interface
<section id="content">
<header class="title">
<h1 id="----npm-whoami----11170">
<h1 id="----npm-whoami----11180">
<span>npm-whoami</span>
<span class="version">@11.17.0</span>
<span class="version">@11.18.0</span>
</h1>
<span class="description">Display npm username</span>
</header>
+3 -3
View File
@@ -186,9 +186,9 @@ npm command-line interface
<section id="content">
<header class="title">
<h1 id="----npm----11170">
<h1 id="----npm----11180">
<span>npm</span>
<span class="version">@11.17.0</span>
<span class="version">@11.18.0</span>
</h1>
<span class="description">javascript package manager</span>
</header>
@@ -203,7 +203,7 @@ npm command-line interface
</code></pre>
<p>Note: This command is unaware of workspaces.</p>
<h3 id="version">Version</h3>
<p>11.17.0</p>
<p>11.18.0</p>
<h3 id="description">Description</h3>
<p>npm is the package manager for the Node JavaScript platform.
It puts modules in place so that node can find them, and manages dependency conflicts intelligently.</p>
+2 -2
View File
@@ -186,9 +186,9 @@ npm command-line interface
<section id="content">
<header class="title">
<h1 id="----npx----11170">
<h1 id="----npx----11180">
<span>npx</span>
<span class="version">@11.17.0</span>
<span class="version">@11.18.0</span>
</h1>
<span class="description">Run a command from a local or remote npm package</span>
</header>
+2 -2
View File
@@ -186,9 +186,9 @@ npm command-line interface
<section id="content">
<header class="title">
<h1 id="----folders----11170">
<h1 id="----folders----11180">
<span>Folders</span>
<span class="version">@11.17.0</span>
<span class="version">@11.18.0</span>
</h1>
<span class="description">Folder structures used by npm</span>
</header>
+2 -2
View File
@@ -186,9 +186,9 @@ npm command-line interface
<section id="content">
<header class="title">
<h1 id="----install----11170">
<h1 id="----install----11180">
<span>Install</span>
<span class="version">@11.17.0</span>
<span class="version">@11.18.0</span>
</h1>
<span class="description">Download and install node and npm</span>
</header>
+2 -2
View File
@@ -186,9 +186,9 @@ npm command-line interface
<section id="content">
<header class="title">
<h1 id="----folders----11170">
<h1 id="----folders----11180">
<span>Folders</span>
<span class="version">@11.17.0</span>
<span class="version">@11.18.0</span>
</h1>
<span class="description">Folder structures used by npm</span>
</header>
+2 -2
View File
@@ -186,9 +186,9 @@ npm command-line interface
<section id="content">
<header class="title">
<h1 id="----packagejson----11170">
<h1 id="----packagejson----11180">
<span>package.json</span>
<span class="version">@11.17.0</span>
<span class="version">@11.18.0</span>
</h1>
<span class="description">Specifics of npm's package.json handling</span>
</header>
@@ -186,9 +186,9 @@ npm command-line interface
<section id="content">
<header class="title">
<h1 id="----npm-shrinkwrapjson----11170">
<h1 id="----npm-shrinkwrapjson----11180">
<span>npm-shrinkwrap.json</span>
<span class="version">@11.17.0</span>
<span class="version">@11.18.0</span>
</h1>
<span class="description">A publishable lockfile</span>
</header>
+2 -2
View File
@@ -186,9 +186,9 @@ npm command-line interface
<section id="content">
<header class="title">
<h1 id="----npmrc----11170">
<h1 id="----npmrc----11180">
<span>.npmrc</span>
<span class="version">@11.17.0</span>
<span class="version">@11.18.0</span>
</h1>
<span class="description">The npm config files</span>
</header>
+2 -2
View File
@@ -186,9 +186,9 @@ npm command-line interface
<section id="content">
<header class="title">
<h1 id="----packagejson----11170">
<h1 id="----packagejson----11180">
<span>package.json</span>
<span class="version">@11.17.0</span>
<span class="version">@11.18.0</span>
</h1>
<span class="description">Specifics of npm's package.json handling</span>
</header>
@@ -186,9 +186,9 @@ npm command-line interface
<section id="content">
<header class="title">
<h1 id="----package-lockjson----11170">
<h1 id="----package-lockjson----11180">
<span>package-lock.json</span>
<span class="version">@11.17.0</span>
<span class="version">@11.18.0</span>
</h1>
<span class="description">A manifestation of the manifest</span>
</header>
Loaded 100 of 293 files, more files were not shown because too many files have changed in this diff. Show more