HACKER Q&A
📣 mind-blight

Are people choosing yarn over NPM or pnpm? Why or why not?


Yarn was fantastic when it first came out. It really pushed the other node package managers to focus on stability and performance. Recently, I've run into issues with how it manages packages in a monorepo, and it seems to result in larger `node_modules/` than either pnpm or npm.

Are folks still choosing yarn for new projects, and if so what's making you choose it over other options?


  👤 jangoforhire Accepted Answer ✓
My list:

pnpm - my goto now. It's fast, enforces that you have your dependencies set up correctly (no transitives etc.), and still allows settings to simulate older `node_modules` structures that some things (`prisma` / `storybook` etc.) need to work.

yarn v1 - Used to be my default, so I still have some older projects using it, but I'm slowly moving them all to `pnpm`.

yarn berry - only if I have to. I'm sure it's great, but the mental model shift was too extreme

npm - never


👤 Leftium
I switched from Yarn (2) to pnpm last year.

Right before I switched, I helped someone with a problem deploying a prisma project to Vercel.

Yarn just worked (or maybe it was vanilla npm?), but pnpm needed a crazy work-around. I think the issue was pnpm was putting files generated by prisma in a weird location that couldn't be accessed after build.

Oh, also with my nodejs setup installing modules globally didn't work. Worked with yarn, but I just install global modules with vanilla npm, now.