- Install Corepack, an intermediary tool that will let you configure your package manager version on a per-project basis:
npm install -g corepack- Then initialize a new project:
yarn init -2
Updating Yarn
Section titled “Updating Yarn”Any time you’ll want to update Yarn to the latest version, just run:
Yarn will then configure your project to use the most recent stable binary.
Installing the latest build fresh from master
Section titled “Installing the latest build fresh from master”You may want to test a version of Yarn so recent it hasn’t been released in a Release Candidate yet, or even not merged. The following command will clone, build, and install Yarn in your project, straight from our repository:
It accepts a --branch flag which you can use to test specific PRs: