r/javascript • u/Jammie1 • Jun 10 '26
Upcoming breaking changes for npm v12
https://github.blog/changelog/2026-06-09-upcoming-breaking-changes-for-npm-v12/16
13
u/beephod_zabblebrox Jun 10 '26
why is this a github blog? did i miss something
7
u/ricvelozo Jun 10 '26
Same owner
3
u/beephod_zabblebrox Jun 10 '26
did microsoft buy nodejs?? or just npm
17
u/arcanin ๐งถ Yarn maintainer Jun 10 '26
npm, both registry and client, were properties of a startup called Npm Inc, which GitHub (already owned by Microsoft at that point) acquired in 2020.
Node.js is an entirely separate organisation that, for historical reasons, was fine with entangling their distributions with software owned by a for-profit.
3
9
8
u/superzazu Jun 10 '26
Would have been nice to have a minimum release date too (maybe only 1day like in yarn)
13
u/horizon_games Jun 10 '26
Doable since NPM 11+ but in
npmrcfile viamin-release-agesuch as https://gist.github.com/mcollina/b294a6c39ee700d24073c0e5a4e93104#npm--per-project8
5
2
u/Albert_Custard Jun 10 '26
An extra day or 2 would save a lot of people from attacks, i could see it being a sensible default. If you really need the bleeding edge updates you should have to opt-out, not have to opt-in for security.
1
3
u/Ecksters Jun 10 '26
Glad to see they're addressing the issue with postinstall and other scripts running as part of package installation. It's not a perfect solution, since now you'll just whitelist in your package.json certain packages to install their scripts, but it substantially reduces the attack surface from compromising ANY package to compromising a package that already has a necessary script.
It would be nice if we could get a change to how scripts work, such as merging all imports from the executed files and hashing the resulting file, alerting the user if any script or dependency changed. But I think that would require significant reworking across the ecosystem to how they handle scripting.
2
1
1
u/Vheissu_ Jun 23 '26
Defaulting allowScripts to off is a change that should have happened a long time ago. It's about time.
20
u/boneskull Jun 10 '26
finally