6/10/2026 at 7:40:57 AM
postinstall scripts should've been removed long time ago, it's the cancer of NPM packages. There's so many deeply nested, uncontrolled postinstalls that run randomly when you pull something it's insane, I don't know how someone at some point ever though that was a good idea.by atraac
6/10/2026 at 10:01:15 AM
I must admit I don't really understand what the point of the post-install script concern is.Usually, you run the actual packaged dependency code at some point anyway, and usually with the same permissions as the install process.
So all of these setup scripts (good or bad) can just move their entrypoint from npm to wherever the `import` or `require` happens.
It seems to me that this is a small stumbling block at best, unless the whole ecosystem moves to a deno-like sandboxed environment. Maybe that is the plan?
by VMG
6/10/2026 at 8:39:41 AM
Absolutely not, there are plenty of use-cases for them. https://www.npmjs.com/package/patch-package comes to mind off the top of my head.Hopefully current hysteria will not result in some bs decisions like this.
by gear54rus
6/10/2026 at 9:02:09 AM
Your own link says that a proper package manager (e.g. pnpm) supports this out of the box.If there are other use cases that really need post-install scripts, you can whitelist just those in pnpm. In projects I'm working with, there are often zero post-install scripts that must be enabled for everything to work properly, and it's usually from poorly cobbled packages that use them to download prebuilt binaries (well written packages, like biome or tsgo, use per-architecture subpackages).
You enable just one or two of those, and block everything else.
by homebrewer
6/10/2026 at 8:41:37 AM
The entire use-case of that package is a security nightmare.by philipwhiuk
6/10/2026 at 8:46:26 AM
Then don't use it. Just don't presume to tell me if I can or can't.by gear54rus
6/10/2026 at 8:51:29 AM
Given that has an impact over the whole industry, I will for sure tell you that patching on install SHOULD NOT be a thing. Up to you to run your own post install script yourselfby dgellow
6/10/2026 at 9:00:57 AM
It absolutely should and maybe I'll run and advertise a fork that will behave properly. Yay open-source.by gear54rus
6/10/2026 at 9:23:18 AM
Elaborate on the "behave properly". What is properly here?by ramon156
6/10/2026 at 10:00:10 AM
You’re free to allow scripts as per the linked docs for NPM 12. But the vast majority of us will appreciate the reduced attack surface.by port11