Yarn keeps telling me to rename folder

Viewed 313

Yesterday, yarn worked just fine, but today yarn absolutely refuses to work. Running any kind of yarn command fails.

Internal Error: EPERM: operation not permitted, rename 'C:\Users\NAME\.node\corepack\corepack-4304-ea1e7c84.0eb04' -> 'C:\Users\NAME\.node\corepack\yarn\3.1.1'

I tried following the instructions.

I also noticed that the referenced .node folder was read-only. This is weird because every time I try to use yarn, the corepack-RANDOMSTRING is a new folder.

Removing read-only from the folder and checking if it has been removed says it is read only again.

1 Answers
  1. Make sure you are running the CMD prompt as Administrator

  2. Then install Yarn npm install --global yarn

  3. Verify that Yarn installed correctly yarn --version It should print the version number.

If that doesn't work try adding the --force flag as @sfuqua mentions in the comments so npm install --global yarn --force

Note: Reading through this article https://github.com/yarnpkg/yarn/issues/992 It looks like there are many reasons why this could occur.

Related