pnpm run build fails on Windows with spawnSync npm ENOENT
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 75/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- nodejs, shell, typescript
- 领域
- build-system, cli
调研方向
问题出在 scripts/build-coding-agent-bundle.mjs 中,execFileSync 调用了 npm。在 Windows 上,可执行文件是 npm.cmd。检查项目中其他脚本在 Windows 上如何调用 npm,很可能使用 cmd.exe /c 或 shell。查看 execFileSync 调用并修改它以使用正确的可执行文件路径或 shell。在 Windows 机器或 Windows CI 环境中运行 pnpm run build 以验证修复。
由索引模型根据 Issue 内容生成。
描述
What happened?
pnpm run build fails on Windows while bundling @step-harness/coding-agent. TypeScript compilation and copy-assets finish, then scripts/build-coding-agent-bundle.mjs exits with spawnSync npm ENOENT.
Environment: Windows 10 (10.0.26200), Node.js v24.14.1, pnpm 9.15.9, package @step-harness/[email protected] at commit 8297eb5.
node:internal/child_process:1119
result.error = new ErrnoException(result.error, 'spawnSync ' + options.file);
^
Error: spawnSync npm ENOENT
code: 'ENOENT',
syscall: 'spawnSync npm',
path: 'npm',
spawnargs: [
'--prefix',
'D:\\code\\git-project\\Step-Code\\apps\\cli',
'run',
'build'
]
}
The stack points at execFileSync("npm", ["--prefix", appEntryDir, "run", "build"], ...) in scripts/build-coding-agent-bundle.mjs.
Earlier npm run build steps in the same pnpm run build succeed, because pnpm launches them through cmd.exe /c. execFileSync does not use a shell and does not search PATHEXT, so it looks for a file named npm. On Windows the executable is npm.cmd.
Steps to reproduce
- Clone the repo on Windows and run
pnpm install --ignore-scripts. - Run
pnpm run buildfrom the repository root.
Expected behavior
pnpm run build completes, including the CLI compile started by the coding-agent bundle script.
- 主要语言
- TypeScript
- 星标
- 850
- 派生
- 62
- 平均合并
- 1 天 7 小时
- 30 天内合并 PR
- 56
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
stepfun-ai/Step-Code 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
stepfun-ai/Step-Code#269 · 1 条评论 ·
维护者通常 1 天内回复
-
area/tools bug
难度 2/5 1-3 小时 新手友好度 75/100
stepfun-ai/Step-Code#186 · 1 条评论 ·
维护者通常 1 天内回复
-
area/tools bug
难度 2/5 1-3 小时 新手友好度 75/100
stepfun-ai/Step-Code#185 · 1 条评论 ·
维护者通常 1 天内回复
-
area/tools bug
难度 2/5 1-3 小时 新手友好度 75/100
stepfun-ai/Step-Code#184 · 1 条评论 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 75/100
stepfun-ai/Step-Code#179 · 1 条评论 ·
维护者通常 1 天内回复
查看 stepfun-ai/Step-Code 的全部 Issue
相似的 Issue
-
[Android] Nested transforms are composed in reverse order可能已有人在做 @Danyalo 今天认领。 未关闭Repro provided
难度 2/5 1-3 小时 新手友好度 74/100
software-mansion/react-native-svg#3090 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
radix-ui/primitives#4228 ·
维护者通常 1 天内回复
-
bug
难度 1/5 1 小时以内 新手友好度 95/100
rocketride-org/rocketride-server#2705 · 1 条评论 ·
维护者通常 1 天内回复
-
archon-ready archon-size-s archon-type-bug area: web
难度 2/5 1-3 小时 新手友好度 82/100
coleam00/Archon#4707 · 1 条评论 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 70/100
HarperFast/grafana-datasource#177 ·