Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

pnpm run build fails on Windows with spawnSync npm ENOENT

Open Beginner friendly
#190 0 comments 0 reactions 0 assignees View on GitHub

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
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

  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.

Dominant language
TypeScript
Stars
54
Forks
20
Avg merge
4h 1m
Merged PRs (30d)
12

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from stepfun-ai/Step-Code

All issues in stepfun-ai/Step-Code

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.