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.
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…
Upcoming breaking changes for npm v12
171–180 of 221 posts
Re: Upcoming breaking changes for npm v12
#172postinstall 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.
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.
I work in a monorepo where running install calls dozens of deeply nested postinstalls of some elaborate NextJs or React Native dependencies other projects use. It's borderline insane. Unless you regularly screen everything, it's impossible to know whether one of those is compromised, especially in the world of Node where is-even is being used and the sheer amount of crypto scams around.
Re: Upcoming breaking changes for npm v12
#173What a pointless change. If you force every user to just use "--enable-unsecure-feature", guess what will happen? This is not about improving security. This is about shifting blame. A much better alternative would've been the introduction of sandboxes or simulation runs that would output which scripts and programs are running due to unpredictable dependencies. This way the user could check before the actual execution…
This is kind of like arguing that immutable by default variables are pointless. If you force every user to just write "mut", guess what will happen? They will write "mut" when they need mutable variables, which in practice turns out to be the minority of variables. It's the same with "Option". The vast majority of variables or struct members do not need to be nullable at all.
This is the wrong analogy.
The equivalent analogy would be using a compiler flag that is triggered for all dependencies and all included libraries without a per-library or per-file changeability. Something like "gcc --force-mut-all-yolo".
Variables have scopes of concern. This new NPM feature has no scope. And that's what my critique is about, because it makes it still unpredictable if any of your dependencies of dependencies needs a script.
The spread vector of potential malware stays identical, because the reason the miasma worm is spreading so fast is because of dependencies of dependencies that are impossible to audit on a case-by-case basis, given the lack of sandboxes and the lack of allowlisting scripts on a per-dep-and-version basis.
Re: Upcoming breaking changes for npm v12
#174I'm not sure how I missed that npm was acquired by GitHub, but man, a lot of stuff suddenly makes a lot of sense. I really can't think of a worse home for such a critical part of the Node ecosystem.
https://github.blog/news-insights/company-news/npm-is-joinin...
Re: Upcoming breaking changes for npm v12
#175I'm not sure how I missed that npm was acquired by GitHub, but man, a lot of stuff suddenly makes a lot of sense. I really can't think of a worse home for such a critical part of the Node ecosystem.
Re: Upcoming breaking changes for npm v12
#176Earlier quoted context omitted.
Was that the case? Can you provide sources to your claims and provide a foundation to your theories?
It's literally a Google search away. If you had the time to write this comment, you had more than enough time to do the search.
Re: Upcoming breaking changes for npm v12
#177I don't get it. How does this help with anything? You pull in a dependency to use it, right?
Well pulling some code is different than running a script on your machine
Someone else in this thread mentioned that npm can be used to manage pure front end libraries, which is a fair point.
Re: Upcoming breaking changes for npm v12
#178I'm not sure how I missed that npm was acquired by GitHub, but man, a lot of stuff suddenly makes a lot of sense. I really can't think of a worse home for such a critical part of the Node ecosystem.
Re: Upcoming breaking changes for npm v12
#179Earlier quoted context omitted.
MSFT acquisition of NPM was a massive shit show, they fired many staff engineers and people that were at github for quite a while. Top comment was a liar.
I was part of the npm team at GitHub. They laid off almost the entire team to focus on AI (CTO literally told us on the layoff announcement call that they're doing this to focus on Copilot)
Re: Upcoming breaking changes for npm v12
#180Earlier quoted context omitted.
Java‘s Maven never had them, never felt a need for them. What is their purpose in JS land?
native modules. nodejs can have native modules (written in C++, Rust, etc...). Projects usually ship prebuilt natives binaries (for each arch/OS/Nodejs ABI combination) hosted on GitHub Releases and download them automatically at installation time; fallback to build from source if not found. that's where scripts are used the reason for not bundling all native binaries is becasue the no. of combinations are huge and i…
That sounds like an NPM problem that would be relatively easy to fix.
Can the builds be sandboxed with strictly limited capabilities?
All of this sounds solvable, why hasn't it?