Back in 2016, npm was a shitshow.
Slow installs, inconsistent dependency resolution, and zero-installs that somehow took 10 minutes. Facebook got fed up and built Yarn to fix what npm couldn't handle.
What Actually Changed
npm 11.6.0 (released September 2025) is pretty decent now, but Yarn still has advantages:
Yarn's lockfile is bulletproof. Your yarn.lock
guarantees the same dependency tree every time. npm's package-lock.json
gets corrupted more often than you'd like.
Workspaces that don't suck. If you're doing monorepos, Yarn workspaces actually work. npm workspaces exist but feel like an afterthought.
Better caching. Once Yarn downloads a package, it's cached globally.
No more downloading React 47 times for different projects.
The PnP Problem
Here's where things get complicated. Yarn's Plug'n'Play mode generates a `.pnp.cjs` file instead of node_modules
.
Sounds great
- no more dependency hell!
Reality check: PnP breaks half your tools. ESLint extensions stop working in VS Code. Some packages just refuse to load.
I've seen teams spend weeks debugging PnP compatibility issues.
The good news? Yarn 4.9.4 defaults to node_modules
mode now.
You can enable PnP if you hate yourself.
Performance Reality Check
Benchmark data shows cached installs are fast:
Usually fastest at ~0.5-1 seconds
But first installs? Expect 30-60 seconds regardless of your package manager. The network is still the bottleneck.
When Yarn Makes Sense
Use Yarn if:
- You're building monorepos (workspaces are genuinely good)
- Your team keeps getting different dependency versions
- npm installs keep failing mysteriously
Stick with npm if:
- Your project is simple
- You don't want to learn new commands
- Your CI/CD is already set up
Try pnpm if:
- You want the fastest installs
- Disk space matters (shared dependencies across projects)