6
top 1 comments
sorted by: hot top new old
[-] something183786@lemmy.world 6 points 2 weeks ago

Finally!!!

allowScripts defaults to off: npm install will no longer execute preinstall, install, or postinstall scripts from dependencies unless they are explicitly allowed in your project. This includes native node-gyp builds (i.e., a package with a binding.gyp and no explicit install script still gets blocked, because npm runs an implicit node-gyp rebuild for it). prepare scripts from git, file, and link dependencies are blocked the same way. To see what would be blocked, run npm approve-scripts --allow-scripts-pending. Then allow the packages you trust with npm approve-scripts and block the rest with npm deny-scripts. The resulting allowlist is written to package.json and should be committed. If your install routine runs scripts, you can observe warnings in npm 11.16.0+.

this post was submitted on 09 Jun 2026
6 points (100.0% liked)

JavaScript

2746 readers
7 users here now

founded 3 years ago
MODERATORS