New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade yarn to v3 #5022
Upgrade yarn to v3 #5022
Conversation
This ensures that changes to the lockfile are committed
Also update the links to the v2+ docs
Hmm... interesting. Can you explain more about what each of the new files is for, where the relevant documentation is, and what the upgrade process for future versions of It looks like this adds the |
The migration guide can be found here. Upgrading to future versions of yarn should be as simple as doing As for the new files, the
I'm not sure but I think if everyone uses Corepack then committing the yarn binary won't be necessary. But Corepack is only available in newer versions of node and so the official migration guide does say to commit the binary for those who installed yarn from a different package manager(npm, homebrew, apt, etc) |
Cool. I think we should go the route of building the instructions around the Corepack approach, rather than including the binary and maintaining compatibility with older node versions. It would be good to add a section on upgrading |
I've removed the yarn binary. Now Corepack is used to ensure that everyone is using the same version of |
fc24f2b
to
f232589
Compare
As discussed, I've reverted this change. I found a way to use corepack on the CI after taking a look at the workflow of the corepack repository itself but its probably not worth the extra effort. When setup node supports corepack out of the box, this should be a lot more straightforward. |
When I try this locally, I get errors while importing the dependencies. In particular (in addition to many warnings):
|
This upgrades yarn from v1(yarn classic) to v3(yarn modern)
In order to update your local version of yarn, you have two options
Using NPM or another package manager
If you don't want to uninstall the current global `yarn` for some reason, you should update to the latest version of yarn 1. If installed via npm, doUsing Corepack
This is the way recommended by Yarn
Corepack is shipped by default in node
14.19.0+
and node16.9.0+
. In this case, you need not install anything. However, you should uninstall yarn if you installed it globally(via npm, homebrew or any other package manager)For npm, run the following command
Then enable corepack
Now, you should have access to
yarn
.And that's about it. The
yarn
command will use the binary present in.yarn/releases
, ensuring that everyone has the same version of yarn.