question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue
  • 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.
  1. 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.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:9
  • Comments:12 (3 by maintainers)

github_iconTop GitHub Comments

66reactions
BrandiATMuhkuhcommented, Mar 18, 2020

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

44reactions
lfender6445commented, Jan 21, 2021

i had a default in my root, deleting it did the trick

cat ~/.yarnrc.yml 
> yarnPath: ".yarn/releases/yarn-berry.cjs"

rm -f ~/.yarnrc.yml

npm install -g 'yarn@1.22.1'

yarn -v
> 1.22.10
Read more comments on GitHub >

github_iconTop Results From Across the Web

Migration | Yarn - Package Manager
A step-by-step and in-depth migration guide from Yarn 1 (Classic) to Yarn 2 (Berry).
Read more >
How do I change the version of yarn used? - Stack Overflow
Running yarn -v shows that I currently use 0.23.2 . I ran brew upgrade yarn to get the latest version, which is 0.24.6...
Read more >
Yarn 3.0 Performances, ESBuild, Better Patches
While the migration from Yarn 1 to Yarn 2 brought some discomfort, the migration to Yarn 3 should prove easier - regardless of...
Read more >
It's 2021, and You Should Switch to Yarn 2 - Atomic Spin
Here are three reasons you might have waited to make the switch — and why those reasons are out of date in 2021....
Read more >
Yarn lock: how it works and what you risk without maintaining ...
Important: When you install dependencies in your application or library, only the top-level yarn.lock file is respected.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found