@@ -301,19 +301,22 @@ to the same value as the current version.
301301* Default: ""
302302* Type: String (can be set multiple times)
303303
304- Comma-separated list of packages whose install scripts (\`preinstall\`,
305- \`install\`, \`postinstall\`) are allowed to run. Used as a fallback when no
306- \`allowScripts\` field is set in the root project's \`package.json\`, and for
307- global/npx contexts where no project \`package.json\` exists.
304+ Comma-separated list of packages whose install-time lifecycle scripts
305+ (\`preinstall\`, \`install\`, \`postinstall\`, and \`prepare\` for non-registry
306+ dependencies) are allowed to run. Used as a fallback when no \`allowScripts\`
307+ field is set in the root project's \`package.json\`, and for global/npx
308+ contexts where no project \`package.json\` exists.
308309
309- The \`package.json\` \`allowScripts\` field takes precedence over this setting.
310- Layers are not merged: the first source in the precedence chain that defines
311- any allowlist configuration wins for the entire install.
310+ Each name is matched against a dependency's resolved identity, not against
311+ the package's self-reported name. CLI flags take precedence over
312+ \`package.json\`, which takes precedence over this setting. Layers are not
313+ merged.
312314
313- This setting is part of an opt-in install-script policy. In the current
314- release, scripts are not blocked by default; this setting prepares your
315- project for a future release that will block dependency install scripts
316- unless they are explicitly allowed.
315+ This setting is part of an opt-in install-script policy that will land
316+ across multiple npm releases. In this release, install scripts still run as
317+ they always have. Setting this field does not block anything; it records
318+ your intent so the install command can list the packages that would still
319+ need to be reviewed before the future release that flips the default.
317320
318321
319322
@@ -511,14 +514,15 @@ are same as \`cpu\` field of package.json, which comes from \`process.arch\`.
511514* Default: false
512515* Type: Boolean
513516
514- When \`true\`, all dependency install scripts run regardless of the
515- \`allowScripts \` field in \`package.json\` or the \`allow-scripts\` config. This
516- is an escape hatch for migration and emergency use; its use is strongly
517- discouraged.
517+ Reserved for a future release. When that release lands, setting this to
518+ \`true \` will tell npm to run every dependency install script regardless of
519+ the \`allowScripts\` policy — an escape hatch for migration. Its use will be
520+ strongly discouraged.
518521
519- This setting has no effect in the current release, where dependency install
520- scripts already run by default. It is reserved for a future release that
521- will block them unless explicitly allowed.
522+ In this release, install scripts still run as they always have, so this
523+ setting has no effect on install behaviour. The flag is registered now so
524+ projects can pin it in their tooling ahead of the release that flips the
525+ default.
522526
523527
524528
@@ -1893,13 +1897,13 @@ this warning is treated as a failure.
18931897* Default: false
18941898* Type: Boolean
18951899
1896- When \`true\`, any dependency install script that is blocked by the
1897- \`allowScripts\` policy causes the install to fail with an error instead of
1898- printing a warning and continuing.
1900+ Reserved for a future release. When that release lands, setting this to
1901+ \`true\` will turn the install-script policy from a warning into a hard error:
1902+ any unreviewed install script will fail the install instead of being skipped
1903+ with a notice.
18991904
1900- This setting has no effect in the current release, where dependency install
1901- scripts run by default and no scripts are blocked. It is reserved for a
1902- future release that will block install scripts unless explicitly allowed.
1905+ In this release, install scripts still run as they always have, so this
1906+ setting has no effect on install behaviour.
19031907
19041908
19051909
@@ -3236,13 +3240,13 @@ Options:
32363240 Limits the ability for npm to fetch dependencies from urls.
32373241
32383242 --allow-scripts
3239- Comma-separated list of packages whose install scripts (\`preinstall\`,
3243+ Comma-separated list of packages whose install-time lifecycle scripts
32403244
32413245 --strict-script-builds
3242- When \`true\`, any dependency install script that is blocked by the
3246+ Reserved for a future release. When that release lands, setting this
32433247
32443248 --dangerously-allow-all-scripts
3245- When \`true\`, all dependency install scripts run regardless of the
3249+ Reserved for a future release. When that release lands, setting this
32463250
32473251 --audit
32483252 When "true" submit audit reports alongside the current npm command to the
@@ -3779,6 +3783,8 @@ Options:
37793783[--package <package-spec> [--package <package-spec> ...]] [-c|--call <call>]
37803784[-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]]
37813785[--workspaces] [--include-workspace-root]
3786+ [--allow-scripts <package-list> [--allow-scripts <package-list> ...]]
3787+ [--strict-script-builds] [--dangerously-allow-all-scripts]
37823788
37833789 --package
37843790 The package or packages to install for [\`npm exec\`](/commands/npm-exec)
@@ -3795,6 +3801,15 @@ Options:
37953801 --include-workspace-root
37963802 Include the workspace root when workspaces are enabled for a command.
37973803
3804+ --allow-scripts
3805+ Comma-separated list of packages whose install-time lifecycle scripts
3806+
3807+ --strict-script-builds
3808+ Reserved for a future release. When that release lands, setting this
3809+
3810+ --dangerously-allow-all-scripts
3811+ Reserved for a future release. When that release lands, setting this
3812+
37983813
37993814alias: x
38003815
@@ -3814,6 +3829,9 @@ alias: x
38143829#### \`workspace\`
38153830#### \`workspaces\`
38163831#### \`include-workspace-root\`
3832+ #### \`allow-scripts\`
3833+ #### \`strict-script-builds\`
3834+ #### \`dangerously-allow-all-scripts\`
38173835`
38183836
38193837exports [ `test/lib/docs.js TAP usage explain > must match snapshot 1` ] = `
@@ -4232,13 +4250,13 @@ Options:
42324250 Limits the ability for npm to fetch dependencies from urls.
42334251
42344252 --allow-scripts
4235- Comma-separated list of packages whose install scripts (\`preinstall\`,
4253+ Comma-separated list of packages whose install-time lifecycle scripts
42364254
42374255 --strict-script-builds
4238- When \`true\`, any dependency install script that is blocked by the
4256+ Reserved for a future release. When that release lands, setting this
42394257
42404258 --dangerously-allow-all-scripts
4241- When \`true\`, all dependency install scripts run regardless of the
4259+ Reserved for a future release. When that release lands, setting this
42424260
42434261 --audit
42444262 When "true" submit audit reports alongside the current npm command to the
@@ -4382,13 +4400,13 @@ Options:
43824400 Limits the ability for npm to fetch dependencies from urls.
43834401
43844402 --allow-scripts
4385- Comma-separated list of packages whose install scripts (\`preinstall\`,
4403+ Comma-separated list of packages whose install-time lifecycle scripts
43864404
43874405 --strict-script-builds
4388- When \`true\`, any dependency install script that is blocked by the
4406+ Reserved for a future release. When that release lands, setting this
43894407
43904408 --dangerously-allow-all-scripts
4391- When \`true\`, all dependency install scripts run regardless of the
4409+ Reserved for a future release. When that release lands, setting this
43924410
43934411 --audit
43944412 When "true" submit audit reports alongside the current npm command to the
@@ -4528,13 +4546,13 @@ Options:
45284546 Limits the ability for npm to fetch dependencies from urls.
45294547
45304548 --allow-scripts
4531- Comma-separated list of packages whose install scripts (\`preinstall\`,
4549+ Comma-separated list of packages whose install-time lifecycle scripts
45324550
45334551 --strict-script-builds
4534- When \`true\`, any dependency install script that is blocked by the
4552+ Reserved for a future release. When that release lands, setting this
45354553
45364554 --dangerously-allow-all-scripts
4537- When \`true\`, all dependency install scripts run regardless of the
4555+ Reserved for a future release. When that release lands, setting this
45384556
45394557 --audit
45404558 When "true" submit audit reports alongside the current npm command to the
@@ -5492,6 +5510,8 @@ npm rebuild [<package-spec>] ...]
54925510
54935511Options:
54945512[-g|--global] [--no-bin-links] [--foreground-scripts] [--ignore-scripts]
5513+ [--allow-scripts <package-list> [--allow-scripts <package-list> ...]]
5514+ [--strict-script-builds] [--dangerously-allow-all-scripts]
54955515[-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]]
54965516[--workspaces] [--include-workspace-root] [--install-links]
54975517
@@ -5507,6 +5527,15 @@ Options:
55075527 --ignore-scripts
55085528 If true, npm does not run scripts specified in package.json files.
55095529
5530+ --allow-scripts
5531+ Comma-separated list of packages whose install-time lifecycle scripts
5532+
5533+ --strict-script-builds
5534+ Reserved for a future release. When that release lands, setting this
5535+
5536+ --dangerously-allow-all-scripts
5537+ Reserved for a future release. When that release lands, setting this
5538+
55105539 -w|--workspace
55115540 Enable running a command in the context of the configured workspaces of the
55125541
@@ -5534,6 +5563,9 @@ alias: rb
55345563#### \`bin-links\`
55355564#### \`foreground-scripts\`
55365565#### \`ignore-scripts\`
5566+ #### \`allow-scripts\`
5567+ #### \`strict-script-builds\`
5568+ #### \`dangerously-allow-all-scripts\`
55375569#### \`workspace\`
55385570#### \`workspaces\`
55395571#### \`include-workspace-root\`
@@ -6217,8 +6249,11 @@ Options:
62176249[--omit <dev|optional|peer> [--omit <dev|optional|peer> ...]]
62186250[--include <prod|dev|optional|peer> [--include <prod|dev|optional|peer> ...]]
62196251[--strict-peer-deps] [--no-package-lock] [--foreground-scripts]
6220- [--ignore-scripts] [--no-audit] [--before <date>|--min-release-age <days>]
6221- [--no-bin-links] [--no-fund] [--dry-run]
6252+ [--ignore-scripts]
6253+ [--allow-scripts <package-list> [--allow-scripts <package-list> ...]]
6254+ [--strict-script-builds] [--dangerously-allow-all-scripts] [--no-audit]
6255+ [--before <date>|--min-release-age <days>] [--no-bin-links] [--no-fund]
6256+ [--dry-run]
62226257[-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]]
62236258[--workspaces] [--include-workspace-root] [--install-links]
62246259
@@ -6255,6 +6290,15 @@ Options:
62556290 --ignore-scripts
62566291 If true, npm does not run scripts specified in package.json files.
62576292
6293+ --allow-scripts
6294+ Comma-separated list of packages whose install-time lifecycle scripts
6295+
6296+ --strict-script-builds
6297+ Reserved for a future release. When that release lands, setting this
6298+
6299+ --dangerously-allow-all-scripts
6300+ Reserved for a future release. When that release lands, setting this
6301+
62586302 --audit
62596303 When "true" submit audit reports alongside the current npm command to the
62606304
@@ -6304,6 +6348,9 @@ aliases: u, up, upgrade, udpate
63046348#### \`package-lock\`
63056349#### \`foreground-scripts\`
63066350#### \`ignore-scripts\`
6351+ #### \`allow-scripts\`
6352+ #### \`strict-script-builds\`
6353+ #### \`dangerously-allow-all-scripts\`
63076354#### \`audit\`
63086355#### \`before\`
63096356#### \`min-release-age\`
0 commit comments