DEV Community

Discussion on: npm v/s yarn v/s pnpm

Collapse
 
zirkelc profile image
Chris Cook

All three packager manager support lockfiles (package-lock.json, yarn.lock, pnpm-lock.yaml) and install dependencies according to that. I cannot see any reason to favor Yarn over the others?

Collapse
 
raxraj profile image
Ashutosh Kumar

I do wanna agree, choosing a package manager won't make much of a great difference but I prefer yarn. Also beleive me when I say, I didn't mean Yarn is the only package manager which supports lockfiles. I meant it's package resolution through the lockfile is much faster.

Thanks for making it clear though.

Collapse
 
renzhamin profile image
renzhamin

npm's dependency resolution is inferior compared to yarn. I was working in a react project, after installing some packages, it suddenly became irreproducible on other devices, npm install or npm clean-install just wouldn't work. Tried out yarn and it worked out just fine

Collapse
 
raxraj profile image
Ashutosh Kumar

@renzhamin This happened multiple times with me as well. when it comes to using private GitHub Repo based packages. It's resolution is too slow and often fails on different platforms.

Collapse
 
tnolte profile image
Tim Nolte

It's probably because you were using npm wrong. If you want consistency in the versions installed you need to use npm ci and not npm install.