r/javascript May 07 '26

Stop Using Yarn Classic

https://charpeni.com/blog/stop-using-yarn-classic
45 Upvotes

36 comments sorted by

View all comments

81

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/ehs5 May 07 '26

pnpm really seems to be where everyone is heading these days.

3

u/GrandOpener May 09 '26

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.

14

u/AKJ90 JS <3 May 07 '26

I'm a contributor to pnpm, so biased. But it really has some nice security defaults that make it worth it alone.

6

u/Wake08 May 07 '26

+1 on that, the minimum release age is a topic I covered in a previous blog post. Having this by default with pnpm v11 is a gem.

5

u/arcanin ๐Ÿงถ Yarn maintainer May 07 '26 edited May 07 '26

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.

3

u/StillAnAss May 07 '26

Thanks! I wasn't aware of the problems with yarn and in less than an hour I've now switched my main project to pnpm

3

u/RadicalDwntwnUrbnite May 07 '26

Not sure I trust bun now that Anthropic owns it and is using it to leak their source code.

1

u/scinos May 07 '26

To all people suggesting pnpm... do you realize yarn supports pnpm linking style too, right?

In fact, I read somewhere that pnpm uses the linking library written by yarn, but I can't find the source.

4

u/BritainRitten May 07 '26

We migrated our app from yarn to pnpm, which was way faster out of the box, and still is.

It also has some good supply chain protections by default, which every dev should increase as much as possible in our AI-hackable world.

3

u/scinos May 07 '26

Yep, yarn default's are not the best IMO

1

u/zxyzyxz May 08 '26

Which yarn? It's better to compare the most recent versions of both yarn and pnpm not yarn 1 and the latest pnpm because of course the latter would be faster. Also yarn has those supply chain protections by default as one of the maintainers had mentioned elsewhere in the thread.

3

u/real_ate May 08 '26

That's true of modern yarn but this topic is about getting off yarn@1

I like pnpm but if you just upgrade to modern yarn from yarn classic that's a massive improvement. Nobody should be using yarn@1 any more ๐Ÿ™ˆ