5 ms·
Ask HN: Why is NPM still so buggy and slow?
So NPM is on version 9 or so, and it is still as buggy as ever. All kinds of weird errors, which I don't get when I use yarn or pnpm. It's also comparatively slow.
Why exactly is NPM still buggy and slow after all these years? What are they doing wrong?
For some reason I'd really like to stick with NPM, but the fact that its competitors manage to be consistently better means I might have to bite the bullet and make a permanent switch.
- moomoo11 4y agoWhich errors specifically?
- prmph 4y agoSome weeks ago I had repeated issues with npm getting stuck on installs for maybe 20 minutes and finally erroring out, seemingly due to some network issues. I verified that there was no actual problem with my network, and pnpm installed within seconds. Just as I'm typing this comment, I'm waiting for an npm install to complete for like 10 minutes already, on a project with just maybe 20-ish top level dependencies. It's stuck on this line for like 5 minutes: (####⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠹ idealTree:regjsparser: sill fetch manifest builtin-modules@^3.3.0 It will probably terminate with some kind or error. This will not happen with pnpm or yarn. Even if it does not, the speed of installation with npm is no match for yarn or pnpm. What might take minutes with npm takes seconds with the others. Also earlier today I had to help a team member install some dependencies in a Node project on a Macbook. We were getting all kinds of errors. After much poking around, it turns out we needed to use `sudo` for the install to succeed, and also resolve some version mismatches between some dependencies, but the error messages did not give any clear indication that these were the problems. Yarn and pnpm will usually just work in such situations, and give messages if some minor issue with the install.
- dinkleberg 4y agoInteresting, what problems are you having? I was using pnpm for a while happily until I started running into weird issues in my CI. I switched back to npm and was pleased to find it wasn’t seemingly any slower than pnpm.
- prmph 4y agoSee my other comment at https://news.ycombinator.com/item?id=34914279 https://news.ycombinator.com/item?id=34914279. I also randomly get the following errors when I navigate to the npm website (usually to view information about some package): On Firefox: Secure Connection Failed An error occurred during a connection to www.npmjs.com. SSL received a record with an incorrect Message Authentication Code. Error code: SSL_ERROR_BAD_MAC_READ The page you are trying to view cannot be shown because the authenticity of the received data could not be verified. Please contact the website owners to inform them of this problem. On Safari: Safari Canʼt Open the Page Safari canʼt open the page “https://www.npmjs.com/package/...” https://www.npmjs.com/package/...” because Safari canʼt establish a secure connection to the server “www.npmjs.com”. On Chrome: This site can’t provide a secure connection www.npmjs.com sent an invalid response. ERR_SSL_PROTOCOL_ERROR