8

current yarn version is yarn 3.0.0. Tried changing to yarn 2.0.0 using yarn set version 2.0.0-rc.30. Even after that yarn version still remains at yarn 3.0.0.

Other alternatives I tried: npm uninstall -g yarn then npm install -g yarn. Still yarn version remains at 3.0.0.

Update:

  • managed to get yarn version to 2.0 after deleting yarnrc file from root directory.
BiozterzCodes
  • 165
  • 1
  • 10

2 Answers2

1

For me this worked:

$ yarn --version
3.3.1

$ yarn set version berry
➤ YN0000: Retrieving https://repo.yarnpkg.com/3.3.1/packages/yarnpkg-cli/bin/yarn.js
➤ YN0000: Saving the new release in .yarn/releases/yarn-3.3.1.cjs
➤ YN0000: Done in 0s 299ms

$ yarn --version
3.3.1

$ yarn set version 2.4.2
➤ YN0000: Retrieving https://repo.yarnpkg.com/2.4.2/packages/yarnpkg-cli/bin/yarn.js
➤ YN0000: Saving the new release in .yarn/releases/yarn-2.4.2.cjs
➤ YN0000: Done in 0s 346ms

$ yarn --version
2.4.2
ARKBAN
  • 3,419
  • 4
  • 24
  • 22
0

After some research I found if you have yarn.lock file (even an empty one) yarn set version stops working

Black Beard
  • 1,130
  • 11
  • 18