Yarn versions 2.x and 3.x are now available

Change effective on 13 February 2023

Yarn berry (2.x and 3.x) CLI releases are being made available today for use in Node.js builds. Once the rollout is complete, Node.js apps using Yarn 2 or greater can install the desired Yarn CLI version directly (instead of using the yarn 1.22.x CLI as a proxy) by specifying the appropriate version range in package.json. For example:

{
  “engines”: {
    “yarn”: “3.4.x”
  }
}

If no such version specification exists and a yarn.lock file exists, Yarn version 1.22.x will be installed, just as it did prior to this change.

Projects using open ended version specifiers like ”yarn”: “>= 1.22” should use tighter constraints like ”yarn”: “1.22.x” to prevent using newer Yarn berry releases on projects configured for Yarn classic.

For more information on upgrading from Yarn 1 to Yarn 2, please refer to our migration guide.