Berry: [Bug] Can't switch back to Yarn v1 after trying out Yarn v2

Created on 26 Feb 2020  Â·  6Comments  Â·  Source: yarnpkg/berry

  • [ ] I'd be willing to implement a fix

Describe the bug

I wanted to try out Yarn v2, so I did yarn set version 2. This worked. But now I can't switch back to v1:

> yarn set version 1
^[➤ YN0000: Selecting the highest release amongst 1.22.0 and 18 others
➤ YN0000: Downloading https://github.com/yarnpkg/yarn/releases/download/v1.22.0/yarn-1.22.0.js
➤ YN0000: Saving the new release in .yarn/releases/yarn-1.22.0.js
➤ YN0000: Done in 2.35s

> yarn -v
2.0.0-rc.29

To Reproduce

  1. Start with a regular Yarn 1 installation on macOS, installed via brew.
  2. Run yarn set version 2

    • Running yarn -v now prints 2.0.0-rc.29.

  3. Run yarn set version 1

    • The output makes it look like this worked, but it didn't – yarn -v still prints 2.0.0-rc.29.

Environment if relevant (please complete the following information):

  • OS: macOS
  • Node version: v12.13.0
  • Yarn version: 2.0.0-rc.29

Additional context

Sorry if I'm missing something obvious - I don't know much about Berry/Yarn 2, I just wanted to try it out, and now I can't get back to Yarn 1.

bug good first issue

Most helpful comment

I "fixed" it my going into my users root directory and executing yarn set version ^1. Now it's globally back to v1

All 6 comments

I'm not at my computer at the moment, but I'm pretty sure you'll find a .yarn directory in your home directory, if you delete that you should be able to install v1 again. (I had this problem when I first started using v2 as well)

I've reverted to Yarn 1 by deleting the .yarn directory at the root of the project, plus any other files added in the process. I checked out any changes made to the git repository, and then yarn --version from the project folder would again return v1.22.

Remember that Yarn 2 installs locally, confined to your project.

i'm having the same issue. it's even globally changed to yarn -v. I'm using win10 if that helps.
Even uninstalling yarn and installing it again does not help.

I "fixed" it my going into my users root directory and executing yarn set version ^1. Now it's globally back to v1

You can do Cmd + Shift + > to see hidden files. (dot files.)

I'm not sure there's anything actionable on our side at the moment, so I'm going to close this issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

chrisands picture chrisands  Â·  3Comments

Bessonov picture Bessonov  Â·  4Comments

milichev picture milichev  Â·  3Comments

dzintars picture dzintars  Â·  3Comments

larixer picture larixer  Â·  4Comments