OpenBMB / OpenBMB/PilotDeck

npm run dev fails on Windows with Error: spawn npm ENOENT (Windows 兼容性问题)

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

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
4k
Forks
453
Avg merge
12h 30m
Merged PRs (30d)
46

Description

Describe the bug (问题描述)

When running npm run dev on Windows (using CMD or PowerShell), the development launcher crashes with an Error: spawn npm ENOENT error. This happens because child_process.spawn attempts to call npm directly without { shell: true } or checking for npm.cmd on Windows platforms.

在 Windows 环境下(CMD 或 PowerShell)运行 npm run dev 时,开发启动脚本崩溃并报 Error: spawn npm ENOENT 错误。这是因为在 Windows 系统中 npm 实际上是一个批处理文件(npm.cmd),直接通过 spawn('npm') 调用且未配置 shell: true 会导致找不到可执行文件。

Environment (环境信息)
  • OS: Windows 11 (x64)
  • Node.js version: v22.16.0
  • npm version: v10.x+
Steps to Reproduce (复现步骤)
  1. Clone the repo on a Windows machine.
  2. Run npm install and cd ui && npm install.
  3. Run npm run dev inside the ui directory.
  4. See the error in the console.
Expected Behavior (预期行为)

The dev launcher should support Windows and start the local development servers successfully as mentioned in the documentation.
项目应该像文档中描述的那样,支持 Windows 环境并成功启动本地开发服务。

Actual Behavior & Logs (实际行为与日志)
node:events:496
      throw er; // Unhandled 'error' event
      ^

Error: spawn npm ENOENT
    at ChildProcess._handle.onexit (node:internal/child_process:285:19)
    ...
  errno: -4058,
  code: 'ENOENT',
  syscall: 'spawn npm',
  path: 'npm',
  spawnargs: [ '--workspace', 'ui', 'run', 'dev:concurrent' ]
}

<img width="1521" height="1088" alt="Image" src="https://github.com/user-attachments/assets/53080492-20d0-4381-9e09-795011bba667" />

Contributor guide

No contributing guide indexed for this repository

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.

Research direction

Start with the npm run dev entry point in the ui workflow and trace the development launcher call that invokes child_process.spawn with npm. Reproduce the failure on Windows using CMD or PowerShell, then verify that npm run dev starts the local development servers successfully without the ENOENT error.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, typescript
Domain
tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.