pnpm run build fails on Windows with spawnSync npm ENOENT
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 75/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- nodejs, shell, typescript
- Domain
- build-system, cli
Research direction
The issue is in scripts/build-coding-agent-bundle.mjs where execFileSync calls npm. On Windows, the executable is npm.cmd. Check how other scripts in the project call npm on Windows, likely using cmd.exe /c or a shell. Look at the execFileSync call and modify it to use the correct executable path or a shell. Run pnpm run build on a Windows machine or a Windows CI environment to verify the fix.
Written by the indexing model from the issue text.
Description
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/coding-agent@0.84.4 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.
- Dominant language
- TypeScript
- Stars
- 54
- Forks
- 20
- Avg merge
- 4h 1m
- Merged PRs (30d)
- 12
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from stepfun-ai/Step-Code
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
stepfun-ai/Step-Code#186 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
stepfun-ai/Step-Code#185 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
stepfun-ai/Step-Code#184 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
stepfun-ai/Step-Code#179 · 1 comment ·
-
untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
stepfun-ai/Step-Code#153 · 2 comments ·
All issues in stepfun-ai/Step-Code
Similar issues
-
bug(cli): hapi doctor inline-media prints a fabricated B:\ helper-script path in packaged installs Open
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Crush Open
Difficulty 1/5 Under an hour Newbie friendliness 85/100
catppuccin/catppuccin#3125 ·
-
Add a SECURITY.md Open
Difficulty 1/5 Under an hour Newbie friendliness 90/100
ElementsProject/cln-application#167 · 1 comment · 1 reaction ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Quantco/pnpm-licenses#17 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100