Skip to content

Commit

Permalink
Update questions-and-answers.md
Browse files Browse the repository at this point in the history
  • Loading branch information
arcanis authored Sep 4, 2023
1 parent a13a8ae commit 3a793b3
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ import TOCInline from '@theme/TOCInline';

<TOCInline toc={toc} />

## Why is the `yarn` package on npm still on 1.x?

Modern releases of Yarn haven't been distributed on npm since 2019.

The reason is simple: because Yarn wasn't distributed alongside Node.js, many people relied on something like `npm install -g yarn` as part of their image building. It meant that any breaking change would make their way on everyone using this pattern, and break their deployments.

As a result, we decided to retire the `yarn` npm package and only use it for the few 1.x maintenance releases needed. Yarn is now installed directly from our website, via either [Corepack](https://nodejs.org/api/corepack.html) or `yarn set version`.

## Why should you upgrade to Yarn Modern?

While the Yarn Classic line (1.x) remains a pillar of the JavaScript ecosystem, we recommend upgrading if possible. Why's that?
Expand Down

2 comments on commit 3a793b3

@rafaelfess
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@arcanis What do you think of adding these commands in the docs?

Yarn Stable:
corepack prepare yarn@stable --activate
Yarn Canary:
corepack prepare yarn@canary --activate

@rafaelfess
Copy link

@rafaelfess rafaelfess commented on 3a793b3 Sep 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems others besides me have struggled to setting the yarn versions in NodeJS. See the discord thread.

Please sign in to comment.