nodejs / nodejs/corepack

corepack won't install yarn

Open
#178 15 comments 8 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
3.8k
Forks
279
Avg merge
1h 47m
Merged PRs (30d)
2

Description

$ 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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the reported corepack prepare yarn@stable --activate failure on Windows, then compare it with the working pnpm@latest flow shown in the issue. Trace the Yarn preparation and activation path from the installed Corepack entry point; done means Yarn is installed with yarn.js present and the yarn command starts successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
nodejs, typescript
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.