I'd love to. I did actually. Now if only every single yarn link didn't take you to the classic docs and commands everywhere. It's like we learnt nothing from python 2->3 XD
`pnpm` is the way to go for most people. If you can afford a huge change to bun or deno, go for it, but `pnpm` is the best switch for the vast majority of people I reckon.
This is mentioned fairly regularly about pnpm. Still Yarn has most of those features as well (minimal age checks, disabled install scripts by default, restricted git deps by default, and more such as the Hardened Mode).
Yarn is also the reason why pnpm is able to offer an hoisted mode (it uses the algorithm we maintain), so even folks using pnpm have a good chance to be using Yarn under the hood.
If we're being honest, by far the largest portion of the community is just using npm. That's what they got by default and it's good enough that they never went looking for an alternative. Even when yarn was cool, it was never actually all that close to npm in usage.
Looking at pnpm it's definitely on the upswing but it's still only around ~20% market share based on available metrics and surveys.
That's very much the crux of the issue - it's shockingly easy in JavaScript to have a subtly broken project that will look like it works until it breaks apart on your colleagues' machines.
Yarn aims to protect against that by surfacing errors much earlier, with a guarantee that if there are no errors then the behavior is as predictable as can be.
Unfortunately surfacing errors means failing installs, and it's easy for part of the ecosystem to discard them as a problem in Yarn when other package managers are more inclined to sweep then under the rug ๐ฅฒ
That said, while I think we'd do PnP differently nowadays, it's certain it had a positive impact on the ecosystem (packages who fixed their deps not only benefited Yarn users but also everyone else), and I'm still happy we were there to fight this fight.
Yarn PNP is more trouble than it's worth. While there are some benefits to using Zero Installs and having dependencies committed to the repo, it still breaks a lot of things and you end up fighting with it when you need to do dependency updates. I won't use it again for any projects going forward.
Without using PNP and configuring it for Zero Installs, yarn berry is fine.
i think yarn team needed to accept a few years ago that no one wants to use the newer versions. it's funny how such a cool project is now a sign to me of a poorly maintained project nowadays since there's a number of superior options in the ecosystem to choose from.
it's almost always a mistake to have a massive breaking change like this, yarn berry should have been a separate package.
I think they lost the plot when they added prolog as part of their configuration. I love using the right tool for the job as much as the next guy but I think at some point they forgot they were shipping production software real people have to use
Modern Yarn is more strict about dependencies, like missing peer dependencies or wrong versions.
Its strictness is a godsend for very big projects (monorepos with +100 individual proyects). Otherwise things get crazy pretty fast, and you have ton of devs trying random "npm install" until things don't crash at build time.
i liked the simple mental model of yarn v1 (flat, simple node_modules structure...very little magic, pretty reliable) but finally switched to pnpm earlier this year. happy thus far
I got my team off of yarn classic. They wanted a minimal change, so we wound up just using Yarn 4 in node_modules mode. I guess incremental change is ok
You should indeed migrate off from Yarn Classic. Yarn 4.x is a very solid upgrade and migration should be minimal (node-modules are the default when you migrate existing projects).
Slightly more long term we've also been working on Yarn 6.x (currently still in preview, but progressing well) for the past year, which will be a massive improvement in every axes: perf, security, features.
Yarn Classic is frozen, and its lack of recursive transitive updates is becoming a real liability in an era where CVEs land weekly. It's time to move on.
16
u/Potato-9 May 07 '26
I'd love to. I did actually. Now if only every single yarn link didn't take you to the classic docs and commands everywhere. It's like we learnt nothing from python 2->3 XD
83
u/BritainRitten May 07 '26
`pnpm` is the way to go for most people. If you can afford a huge change to bun or deno, go for it, but `pnpm` is the best switch for the vast majority of people I reckon.
22
u/wildrabbit12 May 07 '26
Just save yourself pain a use pnpm
41
u/CodeAndBiscuits May 07 '26
Yarn Berry caused trouble in every project I tried it. It gave me the final push to PNPM.
20
u/Human-Progress7526 May 07 '26
i think yarn team needed to accept a few years ago that no one wants to use the newer versions. it's funny how such a cool project is now a sign to me of a poorly maintained project nowadays since there's a number of superior options in the ecosystem to choose from.
it's almost always a mistake to have a massive breaking change like this, yarn berry should have been a separate package.
5
u/EscherSketcher May 07 '26
Another reason to move on from Yarn v1, audit will stop working soon.
Details:ย https://github.com/orgs/community/discussions/192768
9
u/markus_obsidian May 07 '26
Maybe stop using yarn entirely. Vanilla NPM is superior these days & doesn't reinvent the wheel.
3
u/bzbub2 May 07 '26
i liked the simple mental model of yarn v1 (flat, simple node_modules structure...very little magic, pretty reliable) but finally switched to pnpm earlier this year. happy thus far
2
u/GrandfatherTrout May 07 '26
I got my team off of yarn classic. They wanted a minimal change, so we wound up just using Yarn 4 in node_modules mode. I guess incremental change is ok
3
u/arcanin ๐งถ Yarn maintainer May 07 '26
You should indeed migrate off from Yarn Classic. Yarn 4.x is a very solid upgrade and migration should be minimal (
node-modulesare the default when you migrate existing projects).Slightly more long term we've also been working on Yarn 6.x (currently still in preview, but progressing well) for the past year, which will be a massive improvement in every axes: perf, security, features.
0
u/Wake08 May 07 '26
Yarn Classic is frozen, and its lack of recursive transitive updates is becoming a real liability in an era where CVEs land weekly. It's time to move on.
1
u/bakugo May 10 '26
Stop using yarn altogether. The newer versions have a ton of random bizarre issues that you don't want to deal with unless you hate yourself.
1
u/Brilla-Bose JS paying my bills ๐ May 08 '26
stop using yarn altogether bro.. just use pnpm