New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Yarn version folder not found when trying to set version while corepack is enabled #334
Comments
I think you'd get better result with
It looks more like a Yarn bug, the command must have some assumption that are not correct when using Corepack? Not sure, maybe you should report that issue to them. |
I get the same error when running |
Facing the exact same issue as MrJonez77. |
I propose a 'manual' workaround that works :
You're good ;) |
@L4m3-DucK This didn't quite work for me, but my config was a little different from the OP (same problem though). Firstly, there were more than just two files in the Definitely something amiss here. Seems like new versions aren't getting installed into the |
This worked for me though thanks |
I wanted it on 4.1.0. So the method worked to get it set to 4.0.2 (because I had a 4.0.2 directory in corepack/yarn), but I had to use So thanks for the help! Hope this gets fixed soon. |
OS: Windows 11
Node.js v18.19.0, installed via Windows installer
Yarn v1.22.21 installed globally via npm
Steps:
enable corepack
yarn init
yarn set version berry
and you get following kind of error:Internal Error: ENOENT: no such file or directory, stat 'C:\Users\{username}\AppData\Local\node\corepack\yarn\4.0.2'
When you go check
C:\Users\{username}\AppData\Local\node\corepack\yarn
there is only folder for version 1.22.21 but not for 4.0.2 which explains the error. When you navigate toC:\Users\{username}\AppData\Local\node\corepack\
a new foldercorepack-{someidentifer}
has been created there. It seems to contain the yarn.js needed but is in the wrong place?Any ideas what is causing this behavior? Way around it is to disable corepack and let
yarn set version
to download yarn binary for the project itself. However, Yarn nowadays recommends to use Corepack so I'd prefer using that if possible. Another workaround is to modify the corepack folders in local appdata but that is just treating the symptoms, not fixing the cause.The text was updated successfully, but these errors were encountered: