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
corepack preapre : ENOENT: no such file or directory, stat #246
Windows with NVM (Node Version Manager)
Node version : v18.14.2
Description
Trying to install the stable version of yarn return an error
Command to reproduce the issue
corepack prepare yarn@stable
Output error
Internal Error: ENOENT: no such file or directory, stat '{COREPACK_HOME}\yarn\3.4.1'
Error: ENOENT: no such file or directory, stat '{COREPACK_HOME}\yarn\3.4.1'
More information about error
By looking for the root cause of the error, I was able to find at which statement the error occurs
The error occurs when installing Yarn intending to rename the temporary folder
I tried to force the closing/destruction of streams but it not working.
On the other hand, by adding a delay just before the renaming, it worked
Here the delay statement : await new Promise(resolve => setTimeout(resolve, 100));
Note: you can also rename manually the tmp directory and move to the install folder
(ex '{COREPACK_HOME}\corepack-35332-42750715.c38c6' -> '{COREPACK_HOME}\yarn\3.4.1')
Reacted by Jan Loewe, Josh Wooding, DryverStudio, Joe Lekie, T. Langhorst, Vincent and Fengyuan Chen
Environment
Windows 11 with NVM 1.1.9
Node version : v18.14.0
I followed the yarn 2+ installation doc and ran into the same situation.
thanks to ShiJuuRoku's information about error, I rename the tmpFolder which appeared after I ran sudo corepack prepare yarn@stable --activate to installFolder and move it to correct place to workaround it
This is pretty bad, as it essentially prevents corepack from functioning at all on Windows (with certain security software?). Maybe you could just run a loop on windows and wait until the file can be moved (only EPERM) or a timeout occurs.
This is a pretty annoying problem for us.
We execute yarn set version latest on our CI and every time yarn updates, we have to use an internal ticket for an admin to rename the folder on our servers.
The problem exists with Trend and Cortex XDR.
Activity
arcanis commentedon Mar 4, 2023
Windows is a little weird, I think it sometimes locks files just after their creation for "malicious file analysis" 🙁
DryverStudio commentedon Mar 21, 2023
Environment
Windows 11 with NVM 1.1.9
Node version : v18.14.0
I followed the yarn 2+ installation doc and ran into the same situation.
thanks to ShiJuuRoku's information about error, I rename the tmpFolder which appeared after I ran
sudo corepack prepare yarn@stable --activateto installFolder and move it to correct place to workaround itmegla-tlanghorst commentedon May 23, 2023
This is pretty bad, as it essentially prevents corepack from functioning at all on Windows (with certain security software?). Maybe you could just run a loop on windows and wait until the file can be moved (only EPERM) or a timeout occurs.
tisonv commentedon Aug 28, 2023
This is a pretty annoying problem for us.
We execute
yarn set version lateston our CI and every time yarn updates, we have to use an internal ticket for an admin to rename the folder on our servers.The problem exists with Trend and Cortex XDR.
aduh95 commentedon Sep 18, 2023
If the rename fails, we could try again after a delay, hopefully that would workaround the issue. PRs welcome.
ngnlTeto commentedon Feb 26, 2024
I implemented the "workaround" and put it into a pull request #398