Live data from Hacker News

Npm v5.0.0 released

blog.npmjs.org

1–10 of 117 posts

Re: Npm v5.0.0 released

#3
>All installs will be saved by default

>since npm@3, npm will automatically update npm-shrinkwrap.json when you save

All installs update shrinkwrap then? doesn't that start to make it redundant to package.json in the first place now. Does this make git tracking package and shrinkwrap mandatory in-case you want to install, test but then roll back the version, as shrinkwrap will already have changed.

edit: Oh I'm supposed to --no-save now for that described flow?

Re: Npm v5.0.0 released

#4

How does this stack up against yarn now?

I never used yarn, but I just did some research about the changes in comparison to yarn. Well, actually they are more similar now, obviously (saving by default for example). In terms of speed, npm has improved as well (https://twitter.com/passcod/status/860437637764571140). Even though npm still seems to be slower than yarn (https://docs.google.com/presentation/d/1re-AGrTOf4zmnXXDMTG1...). At the end, I'd say it's about personal preference, they both get the job done.

Re: Npm v5.0.0 released

#6
Just tried on a couple of projects with a lot of dependencies, we moved to yarn a while ago due to performance issues and it seems to be resolved.

On cold cache: Yarn: 20.94 seconds NPM5: 21.11 seconds

With cache: Yarn: 10.35 seconds NPM5: 15.20 seconds

For some reason, when node_modules folder is still there, yarn exits in a couple hundres milliseconds but npm5 does something for around 5 seconds.

Haven't checked lock file / installation consistency stuff. Yarn has been great on that too so we have no intention to go back but this is a decent release.

Re: Npm v5.0.0 released

#7
post #6

Just tried on a couple of projects with a lot of dependencies, we moved to yarn a while ago due to performance issues and it seems to be resolved. On cold cache: Yarn: 20.94 seconds NPM5: 21.11 seconds With cache: Yarn: 10.35 seconds NPM5: 15.20 seconds For some reason, when node_modules folder is still there, yarn exits in a couple hundres milliseconds but npm5 does something for around 5 seconds. Haven't checked lo…

Also ran some numbers here (with warm cache. node 6.10.3).

  * yarn: 25s
  * npm@5: 28s
  * npm@4: 63s
  * npm@3: 68s
So performance is now comparable, which is awesome, but I'd still stick to yarn because we have been burned too many times by npm v2/v3 with call stack issues and other errors. I don't have the energy (or the time/faith) to go through that again.

Competition is wonderful though. I'll check npm again in 6-12 months and see what the community thinks of it before switching again.

Re: Npm v5.0.0 released

#9
So happy with the --save by default. Someone at work kept installing new dependencies without save (they didn't knew about it, somehow). We then had an unusable package.json. I had to manually find directories in node_modules and install them on production -_-.

Re: Npm v5.0.0 released

#10
First of all: Thank you, yarn, for helping the community see the naked emperor. Deterministic builds by default are such an obvious (in retrospect) core requirement.

Couple questions:

Question 1: Does anyone else who's been around more than a couple years share my view that Yarn : NPM :: IO.JS : Node?

IOW: healthy competition, catalyst for necessary change, ultimately a bridge or stopgap.

Question 2: Any good comprehensive writeups on best practices?Committing lockfiles is a no-brainer. But what about globals? Per-node-version seems logical, but there are also semantic problems with "global" packages vs concept of executable binaries. I'd love to see a strong writeup outlining and defending a standard approach.

Post reply on HN