Preparing for npm v12: install scripts and non-registry sources become opt-in #198547
-
Beta Was this translation helpful? Give feedback.
Replies: 11 comments 25 replies
This comment has been hidden.
This comment has been hidden.
-
|
Will Node 26 eventually ship with npm 12? Or will that wait until Node 27? |
Beta Was this translation helpful? Give feedback.
-
|
Would’ve been nice with a default min package age too👍 |
Beta Was this translation helpful? Give feedback.
-
|
There should be a way out of ignore-scripts, while keeping it for NPM < 11.16.0 In a shared CI environment, we set a global |
Beta Was this translation helpful? Give feedback.
-
|
What is the recommended way to install new packages that include scripts? Current behaviour when Am I missing something? |
Beta Was this translation helpful? Give feedback.
-
|
Does the allow hash the allowed scripts and npm compare hash before running? Is this just accept package x's {type of script} and if changed could still just run arbitrary code on an update? If version matching then does npm disallow version delete and republish same version? If not then there is a hole of I replace version 1.2 version with a new bad version. You accepted that version range and I snuck something different in. |
Beta Was this translation helpful? Give feedback.
This comment was marked as low quality.
This comment was marked as low quality.
-
|
One gap that npm v12 does not address: even with install scripts blocked, a compromised package can still execute malicious code at import time ( We built Commit to score exactly this: publisher concentration, release consistency, maintainer depth — behavioral signals that flag structural risk before a package is compromised. For example, For teams migrating CI to npm v12: worth running your critical dependencies through a behavioral signal check alongside the install script review. Free audit at getcommit.dev/audit. |
Beta Was this translation helpful? Give feedback.
This comment was marked as off-topic.
This comment was marked as off-topic.
-
|
Thanks for this detailed migration guide. For anyone looking for a step-by-step walkthrough of all the v12
6 breaking changes ranked P0–P2 with copy-paste fixes. Hope it helps folks preparing for the transition. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.

strict-allow-scriptsis not the v12 default and won't be. The v12 default is softer: an install script you haven't approved gets skipped, you get a warning, and the install still succeeds. Sonpm install -D esbuildjust works. esbuild lands innode_modules, itspostinstallis skipped, you see a warning saying so. No failure, and no chicken-and-egg.The wall is coming entirely from
strict-allow-scripts=true. That turns the skip into a hard error that fires before npm writes anything, so esbuild never gets installed. That's whyapprove-scripts esbuildcan't find it afterward. There's nothing on disk to approve yet.The other two are doing what they should.
--allow-scriptsis blocked in proj…