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

pnpm run build fails on Windows with spawnSync npm ENOENT

未关闭 适合新手
#190 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
75/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
领域
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 内容生成。

描述

area/build bug

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

  1. Clone the repo on Windows and run pnpm install --ignore-scripts.
  2. Run pnpm run build from 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 模板
  • 阅读贡献指南

从这里开始

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

stepfun-ai/Step-Code 的其他 Issue

查看 stepfun-ai/Step-Code 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

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