You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug?]: yarn set version berry installs the version 4 instead of 3? #5823
When users install our project, we used to do the yarn set version berry, which installed the version 3 and now it tries to install the version 4. Our project is still on Node v16 (upgrade to v18 is in progress) and Yarn v4 is failing to install.
I tried all the commands from the docs and none of them can install the v3.
For example:
yarn set version https://repo.yarnpkg.com/3.6.4/packages/yarnpkg-cli/bin/yarn.js
Resolving https://repo.yarnpkg.com/3.6.4/packages/yarnpkg-cli/bin/yarn.js to a url...
error An unexpected error occurred: "Release not found: https://repo.yarnpkg.com/3.6.4/packages/yarnpkg-cli/bin/yarn.js".
Is there any other way to set the version to 3.x?
thanks
To reproduce
Have Yarn v1 installed.
Try to set version to v3.6.4: yarn set version https://repo.yarnpkg.com/3.6.4/packages/yarnpkg-cli/bin/yarn.js
Reacted by Mark Hingston, Pierpaolo Vanni, Adrian Smijulj, Rimas Lukšys, VeronikaLou, deliotclarke40au, Eric Walker, Romain de Wolff, Vital, startwinter and 1 more
Not directly addressing your report, but you may want to revisit the way you're installing Yarn in the first place. Perhaps use Corepack (as recommended) to get rid of Yarn v1 dependency altogether?
> node -v
v16.20.0
> corepack enable
> yarn set version 3.6.4
Usage Error: This tool requires a Node version compatible with >=18.12.0 (got 16.20.0). Upgrade Node, or set `YARN_IGNORE_NODE=1` in your environment.
This command is ran by Yarn 4, hence the error. If your server stil runs Node 16, you upgraded Yarn to version 4 too fast.
But, if you really want to dig deeper into this workaround, try setting packageManager in package.json, so instead of yarn set version 3.6.4 run npm pkg set packageManager="[email protected]". This way, you won't use Yarn to downgrade Yarn.
changed the title [-][Bug?]: Set version from the repo url does not work[/-][+][Bug?]: "This tool requires a Node version compatible" when running `yarn set version`[/+]on Oct 23, 2023
@arcanis
I don't see how would that help me with the user projects.
I have a possible workaround, need to test it. I really dont want to use the v4 with the YARN_IGNORE_NODE flag, as I don't know the repercussions it would cause.
But still, its not good that you push v4 into the berry keyword.
When v2 came out, there was a part in the docs which said something like: berry will always be Yarn version 2. Then came v3 and it was berry, same with v4.
Reacted by Pierpaolo Vanni, deliotclarke40au, Fabio Reis and Julien Roncaglia
Actually I think I understand the confusion now - I got mistaken by @i4rilu's and @wojtekmaj's posts, I now see your initial problem was different from what I thought. Sorry about that.
The yarn set version berry command (and the berry selector) is an alias for stable, but we never intended to guarantee that it would be an alias for "2.x". As I mentioned "berry" is the name of the modern codebase, so its purpose was mostly to make clear that it would be different from 1.x (something that "stable" didn't properly convey at the time). Back in 2.x it was pointing to the latest stable 2.x release, then the latest 3.x release, etc. So this thread is "not a bug", it's expected that berry always points to the latest release.
However, running yarn set version 3.6.4should work, but due to an actual bug (the one I mentioned in my previous message) it currently doesn't. I'm working on that, but for now I'm afraid there isn't a better option than the environment variable I mentioned (or to tell your users to install Yarn via Corepack). I hope to have it solved tomorrow or Wednesday.
@Piero87 this seems to be a different issue, please open a new thread (I already misunderstood the problem statement once, I want to be sure we don't get confused again).
Reacted by Piero87, Wojciech Maj, Fabio Reis, youngje (heka) and startwinter
changed the title [-][Bug?]: "This tool requires a Node version compatible" when running `yarn set version`[/-][+][Bug?]: `yarn set version berry` installs the version 4 instead of 3?[/+]on Oct 23, 2023
Activity
i4rilu commentedon Oct 23, 2023
Slightly different, but related issue:
wojtekmaj commentedon Oct 23, 2023
Not directly addressing your report, but you may want to revisit the way you're installing Yarn in the first place. Perhaps use Corepack (as recommended) to get rid of Yarn v1 dependency altogether?
brunozoric commentedon Oct 23, 2023
No changes in the error.
wojtekmaj commentedon Oct 23, 2023
yarn set version 3.6.4This command is ran by Yarn 4, hence the error. If your server stil runs Node 16, you upgraded Yarn to version 4 too fast.
But, if you really want to dig deeper into this workaround, try setting
packageManagerinpackage.json, so instead ofyarn set version 3.6.4runnpm pkg set packageManager="[email protected]". This way, you won't use Yarn to downgrade Yarn.arcanis commentedon Oct 23, 2023
As a stopgap, can you try setting
export YARN_IGNORE_NODE=1in your CI?[-][Bug?]: Set version from the repo url does not work[/-][+][Bug?]: "This tool requires a Node version compatible" when running `yarn set version`[/+]brunozoric commentedon Oct 23, 2023
@arcanis
I don't see how would that help me with the user projects.
I have a possible workaround, need to test it. I really dont want to use the v4 with the
YARN_IGNORE_NODEflag, as I don't know the repercussions it would cause.But still, its not good that you push v4 into the
berrykeyword.When v2 came out, there was a part in the docs which said something like:
berrywill always be Yarn version 2. Then came v3 and it wasberry, same with v4.arcanis commentedon Oct 23, 2023
Piero87 commentedon Oct 23, 2023
arcanis commentedon Oct 23, 2023
Actually I think I understand the confusion now - I got mistaken by @i4rilu's and @wojtekmaj's posts, I now see your initial problem was different from what I thought. Sorry about that.
The
yarn set version berrycommand (and theberryselector) is an alias forstable, but we never intended to guarantee that it would be an alias for "2.x". As I mentioned "berry" is the name of the modern codebase, so its purpose was mostly to make clear that it would be different from 1.x (something that "stable" didn't properly convey at the time). Back in 2.x it was pointing to the latest stable 2.x release, then the latest 3.x release, etc. So this thread is "not a bug", it's expected thatberryalways points to the latest release.However, running
yarn set version 3.6.4should work, but due to an actual bug (the one I mentioned in my previous message) it currently doesn't. I'm working on that, but for now I'm afraid there isn't a better option than the environment variable I mentioned (or to tell your users to install Yarn via Corepack). I hope to have it solved tomorrow or Wednesday.@Piero87 this seems to be a different issue, please open a new thread (I already misunderstood the problem statement once, I want to be sure we don't get confused again).
wojtekmaj commentedon Oct 23, 2023
[-][Bug?]: "This tool requires a Node version compatible" when running `yarn set version`[/-][+][Bug?]: `yarn set version berry` installs the version 4 instead of 3?[/+]Piero87 commentedon Oct 23, 2023
arcanis commentedon Oct 23, 2023
I opened a thread to consolidate information around the
yarn set versionbug at #5829. Closing this one as duplicate.rdewolff commentedon Oct 30, 2023
Thanks for the tip, helped me solved an issue while deploying on vercel
bamf2077 commentedon Dec 6, 2023
I think
berry=latest=stable, just like this repository with the same name, represents the mainline development version of Yarn.berryis not a code name of specific version like Node v20 LTSIron, Debian 12bookworm, Android 13Tiramisu, so there is no Yarn v3c***or v4d***.popuguytheparrot commentedon Dec 23, 2023
i have issue with not install 4 version