Two popular package managers in the ecosystem are NPM (Node package manager) and Yarn (package manager created by Facebook).
Which one do you use and why do you prefer it over the other?
Two popular package managers in the ecosystem are NPM (Node package manager) and Yarn (package manager created by Facebook).
Which one do you use and why do you prefer it over the other?
For further actions, you may consider blocking this person and/or reporting abuse
Latest comments (22)
Yarn! It's way faster and has much prettier output.
My preference is to use npm because I have never really experienced that many problems with it. I have used yarn a few times and it feels like its almost exactly the same as npm. And because npm seems to have more usage I have just stuck with it for now. Unless I can see some real significant performance gains they seem to be more a less the same. It is like comparing React to Angular its just two different ways of doing the same thing.
This was exactly what I thought until I used
yarn
. Most of the tutorials and open source projects online usenpm
in their installations guides, so I assumed it was better. I now useyarn
always because it’s much speedier and has nicer output.For me doesn't really matter which one to use as long as the real problem exists which is the node_modules folder, unfortunately after over a decade of NodeJs this problem still isn't fixed, why should I have more than 30k of dependency files for every simple Create-React-App app, why there is not a centralized dependency management solution like C#, Currently I have a few React and Angular projects and the size of node_modules folders are almost 5GB and millions of files, I know there are some solution for this like PNPM but they are not without problems and also not as straight forward.
I have recently tried yarn and liked it mostly for its speed and for its clear explanations of what is happening
I prefer Yarn. Not sure why tbh. Feels a little cleaner to me. But I bounce between the two.
I use npm because I'm lazy, but i reccomend pnpm.
I am using it in my current project where we also implemented yarn workspaces, which is quite easy to maintain with yarn instead using it through npm.
I prefer yarn over npm because of the performance benefits
Performance while installing packages
As well as
Its commands are shorter, take less keystrokes to run
npm. Because it works.
Yarn workspace is the game changer for monorepo.