nodejs / nodejs/corepack

Error: Cannot find module 'C:\Program Files\nodejs\node_modules\corepack\dist\yarn.js'

Open
#751 15 comments 5 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

I just upgraded to node 25 and the good news comes to me.
Corepack is no more bundled inside nodejs.

After some research I found that I have to do:
npm install -g corepack // extra
corepack enable // as usual
corepack use yarn@stable // as usual

the corepack use yarn@stable will work but then if I do:

yarn install

I get:

node:internal/modules/cjs/loader:1422
throw err;
^

Error: Cannot find module 'C:\Program Files\nodejs\node_modules\corepack\dist\yarn.js'
at Module._resolveFilename (node:internal/modules/cjs/loader:1419:15)
at defaultResolveImpl (node:internal/modules/cjs/loader:1057:19)
at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1062:22)
at Module._load (node:internal/modules/cjs/loader:1225:37)
at TracingChannel.traceSync (node:diagnostics_channel:328:14)
at wrapModuleLoad (node:internal/modules/cjs/loader:244:24)
at Module.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:154:5)
at node:internal/main/run_main_module:33:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}

Node.js v25.0.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 flow on Windows with Node.js 25: install Corepack globally, run corepack enable and corepack use yarn@stable, then run yarn install. Trace how the enabled Yarn launcher resolves Corepack's installation path, and consider the issue done when yarn install no longer requests the missing dist/yarn.js module.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.