logoalt Hacker News

insanitybittoday at 2:24 PM1 replyview on HN

> That's an INSANE default.

It's also the standard, and by far it's the contrast to not allow this. pnpm has a massive advantage of being the non-standard package manager, npm does not have that - what do you suggest that npm does?


Replies

btowntoday at 2:42 PM

There are so, so many things that NPM could do.

It could require a 48 hour cooldown period on any package update that wants to add an install script that didn't have one before, and has a certain number of downloads. And it could publish the list of these so security researchers have an opportunity to scan them.

It could add an optional key to package.json that allows someone to whitelist which packages can run install scripts.

It could add a Hardened Security program where (1) package maintainers could opt into a program where multi-factor confirmation by maintainers is required on every publish, even those triggered by CI; (2) this hardened package status would be public, and (3) a developer could set a flag in their package.json that causes any npm action to act as if all non-hardened packages had frozen versions.

And so much more.

show 1 reply