Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

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

未关闭
#751 15 条评论 5 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
node.js
领域
tooling

调研方向

在 Windows 上使用 Node.js 25 重现报告的流程:全局安装 Corepack,运行 corepack enable 和 corepack use yarn@stable,然后运行 yarn install。跟踪已启用的 Yarn launcher 如何解析 Corepack 的安装路径,并在 yarn install 不再请求缺失的 dist/yarn.js 模块时,认为 issue 已完成。

由索引模型根据 Issue 内容生成。

描述

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

主要语言
TypeScript
星标
3.8k
派生
279
平均合并
1 小时 47 分钟
30 天内合并 PR
2

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

nodejs/corepack 的其他 Issue

查看 nodejs/corepack 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。