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?]: Running 'yarn set version' in home directory overrides per-repo Yarn versions

See original GitHub issue

Self-service

  • I’d be willing to implement a fix

Describe the bug

“I tried running Yarn v2 CLI on a Yarn v1 project and can’t figure out how to get it to run in classic mode. Even with yarn set version classic it keeps trying to upgrade my repo.” (complaint tweet)

“You have a .yarnrc.yml in your home directory that contains a yarnPath pointing to ~/.yarn/releases/xxx.js” (Correct solution from @arcanis)

“For that to happen, you probably accidentally ran yarn set version inside your home directory rather than an individual project. Perhaps something we should hard block 🤔” (Additional info from @arcanis)

To reproduce

Sorry, I don’t see how to reproduce this with Sherlock. In general I think the steps are something like:

  1. Run yarn set version latest in ~
  2. cd into some path like ~/repos/my-repo that uses Yarn v1
  3. yarn

Environment

Note that this is just from one repo. I got ‘dlx is not found’ on my Yarn v1 repos. And whoops, it’s Yarn v3, not v2 as in the reports.

  System:
    OS: Linux 5.10 Ubuntu 20.04.3 LTS (Focal Fossa)
    CPU: (8) x64 11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz
  Binaries:
    Node: 16.14.0 - /tmp/xfs-cbcaba7c/node
    Yarn: 3.1.0-rc.7.git.20210926.hash-f0d86bd4 - /tmp/xfs-cbcaba7c/yarn

Additional context

I think this is different from #4362, but I’m not very familiar. Sorry if it isn’t! 🙂

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:8
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
arcaniscommented, Jun 30, 2022

Sure! I think just blocking yarn set version in the home directory would be reasonable (and perhaps add a --skip-home-check in case someone really needs it?)

0reactions
dylanh724commented, Sep 18, 2022

For clarity: I just repro’d this in a bash profile on an alt laptop, too.

Read more comments on GitHub >

github_iconTop Results From Across the Web

`yarn set version` | Yarn - Package Manager
This command will download a specific release of Yarn directly from the Yarn GitHub repository, will store it inside your project, and will...
Read more >
Bug listing with status UNCONFIRMED as at 2022/12/24 17 ...
src/plugins/quota/rquota.h: No such file or directory" status:UNCONFIRMED ... Bug:549852 - "net-misc/rsync-3.1.1 logrotate script overrides user-set values" ...
Read more >
Introducing Yarn 2 ! - DEV Community ‍ ‍
Hi everyone! After exactly 365 days of very intensive development, I'm extremely happy to unveil the first stable release of Yarn 2.
Read more >
node-pre-gyp - npm
Node.js native addon binary install tool. Latest version: 0.17.0, last published: 2 years ago. Start using node-pre-gyp in your project by ...
Read more >
[Support Guide] Frequently encountered problems during builds
If you have a build on Netlify that is failing with an error message that you ... Netlify builds set the --ignore-optional flag...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

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