Open z88kat opened 9 months ago
Remove the packageManager
field from your package.json
and try to install yarn again
I also started getting this between March 2 (working) and March 6 (not working).
Here's the logs from the working day:
#13 [deps 2/3] RUN yarn set version ./yarn-4.0.2.cjs
#13 0.941 ➤ YN0000: Downloading file:///usr/src/app/yarn-4.0.2.cjs
#13 1.333 ➤ YN0000: Saving the new release in .yarn/releases/yarn-4.0.2.cjs
#13 1.339 ➤ YN0000: Done in 0s 401ms
#13 DONE 1.4s
After some days, same build, no config changes:
#13 [deps 2/3] RUN yarn set version ./yarn-4.0.2.cjs
#13 1.478 ➤ YN0000: Retrieving file:///usr/src/app/yarn-4.0.2.cjs
#13 1.484 ➤ YN0000: Saving the new release in .yarn/releases/yarn-file.cjs
#13 1.980 ➤ YN0000: Done in 0s 504ms
#13 DONE 2.1s
Looks like set version now changed the file name because of reasons. Then we have a .yarnrc.yml
like this:
nodeLinker: node-modules
yarnPath: .yarn/releases/yarn-4.0.2.cjs
And it causes the error.
No idea why this changed also, but decided to leave here some findings.
If we change the yarnPath to .yarn/releases/yarn-file.cjs
it starts working, but then I couldn't find a good compromise between running locally and running in Docker through Dockerfile.
Try this:
yarnPath
field in your .yarnrc.yml
fileyarn set version --yarn-path 4.0.2
(the --yarn-path
flag is key here).yarn/releases/yarn-4.0.2.cjs
and when building with Docker, it can use this file as well
Self-service
Describe the bug
Suddenly I am now getting this error in my project.
no such file or directory, stat '.yarn/releases/yarn-4.1.0.cjs
yarn install gives me the same error
no such file or directory, stat '/.../.yarn/releases/yarn-4.1.0.cjs
its impossible to install or uninstall yarn at all, there is just no way no matter what I do to get this working in my existing project. I always get the same error.
I have no idea why this suddenly started to happen, but i cannot get it working at all.
To reproduce
yarn install
Environment
Additional context
No response