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

JavaScript

2734 readers
1 users here now

founded 3 years ago
MODERATORS
top 1 comments
sorted by: hot top controversial new old
[–] something183786@lemmy.world 0 points 1 week 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+.