Skip to content

Windows native build fails with "spawnSync npm ENOENT" — build-coding-agent-bundle.mjs:181 missing shell: win32 #137

Description

@7oMB2006

What happened?

Windows 原生(非 WSL)从源码跑 pnpm run build,死在 scripts/build-coding-agent-bundle.mjs:181:

Error: spawnSync npm ENOENT

根因:那行 execFileSync("npm", …) 没带 shell。Windows 上 npm 是 npm.cmd / npm.ps1(没有 npm.exe),非 shell 的 spawn 走 CreateProcess 找不到 .exe,直接 ENOENT;Linux/macOS/WSL 不受影响。

另外,你们已经在 local-release.mjs:92、profile-coding-agent-node.mjs:268、以及 #113(Windows step wrapper)里处理过 Windows 的 .cmd / shell 适配,这个 build 入口只是漏了同一处 shell: process.platform === "win32"。一行补丁:

- execFileSync("npm", ["--prefix", appEntryDir, "run", "build"], { stdio: "inherit", cwd: repoRoot });
+ execFileSync("npm", ["--prefix", appEntryDir, "run", "build"], { stdio: "inherit", cwd: repoRoot, shell: process.platform === "win32" });


### Steps to reproduce

(Windows 11 26200 / Node 24.15.0 / pnpm 9.10.0 / 原生 PowerShell,非 WSL)
git clone https://github.com/stepfun-ai/Step-Code.git && cd Step-Code
pnpm install --ignore-scripts
pnpm run build
# -> Error: spawnSync npm ENOENT (scripts/build-coding-agent-bundle.mjs:181)


### Expected behavior

给 scripts/build-coding-agent-bundle.mjs:181 补上 shell: process.platform === "win32" 后,Windows 原生 pnpm run build 应能编过

### Version

0.1.0

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions