corepack won't install yarn

See original GitHub issue
$ corepack prepare yarn@stable --activate
Preparing yarn@stable for immediate activation...
Internal Error: ENOENT: no such file or directory, stat 'C:\Users\jop\.node\corepack\yarn\3.2.3'
Error: ENOENT: no such file or directory, stat 'C:\Users\jop\.node\corepack\yarn\3.2.3'

After seeing this error, I tried to assist it by making the directory but yarn.js is not found

$ New-Item -ItemType Directory -Force C:\Users\jop\.node\corepack\yarn\3.2.3
$ corepack prepare yarn@stable --activate
Preparing yarn@stable for immediate activation...
$ yarn
Internal Error: Cannot find module 'C:\Users\jop\.node\corepack\yarn\3.2.3\yarn.js'
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:956:15)
    at Module.loadMainModule (C:\Program Files\nodejs\node_modules\corepack\dist\corepack.js:16234:70)
    at Module.runVersion (C:\Program Files\nodejs\node_modules\corepack\dist\corepack.js:15878:52)
    at executePackageManagerRequest (C:\Program Files\nodejs\node_modules\corepack\dist\corepack.js:16123:62)
    at async BinaryCommand.validateAndExecute (C:\Program Files\nodejs\node_modules\corepack\dist\corepack.js:12484:26)
    at async Cli.run (C:\Program Files\nodejs\node_modules\corepack\dist\corepack.js:12145:24)
    at async main (C:\Program Files\nodejs\node_modules\corepack\dist\corepack.js:16163:16)
$ corepack prepare pnpm@latest --activate
Preparing pnpm@latest for immediate activation...
$ pnpm
Version 7.11.0

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:2
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ChillyBotscommented, Nov 19, 2022

Same issue with corepack --version: 0.14.2 and a fresh install of node v18.12.1

1reaction
NightWatchmancommented, Nov 4, 2022

I am currently having this issue on corepack v0.14.2.

PS C:\Windows\system32> corepack enable
PS C:\Windows\system32> corepack prepare yarn@stable --activate
Preparing yarn@stable for immediate activation...
Internal Error: ENOENT: no such file or directory, stat 'C:\Users\{redacted}\AppData\Local\node\corepack\yarn\3.2.4'
Error: ENOENT: no such file or directory, stat 'C:\Users\{redacted}\AppData\Local\node\corepack\yarn\3.2.4'
PS C:\Windows\system32> corepack --version
0.14.2

Also, I am trying to set up a build server and I’m concerned that using the user’s appdata folder will be problematic if the build process doesn’t use the logged in user.

Perhaps it would be a good idea to consider using a location like the one returned by System.Environment.GetFolderPath(System.Environment.SpecialFolder.CommonApplicationData) in .NET?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Command not found: corepack when installing Yarn on Node ...
After installing corepack via homebrew, I was able to run the corepack enable command from the terminal and the yarn command became available...
Read more >
Installation | Yarn - Package Manager
Install Corepack. The preferred way to manage Yarn is through Corepack, a new binary shipped with all Node.js releases starting from 16.10.
Read more >
g yarn · Issue #6 · nodejs/corepack - npm install - GitHub
With pmm currently installed, the following currently happens when running npm install -g yarn: npm ERR! code EEXIST npm ERR! syscall ...
Read more >
Support Corepack installation for yarn/pnpm : WEB-52682
Just use nvm and corepack to install yarn but found it cannot be recognized by WebStorm... I love WebStorm but some tiny-but-unbearable problems...
Read more >
How to Install Yarn on Ubuntu {With Screenshots} - phoenixNAP
Note: If Corepack does not exist on your system, install it by typing: sudo npm install -g corepack. 3. Install the latest version...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found