Skip to content

Windows: dev pool fails to boot — spawn npm ENOENT / npm.cmd EINVAL (Node 24.18) #551

Description

@Imnasir-X

Summary

On Windows (Node 24.18.0), the local dev pool cannot install/build plugins:
scripts/dev/deps.ts calls run("npm", ["install"], ...) and run("npm", ["run","build"], ...)
through scripts/dev/lib/proc.ts. On Windows, npm resolves to npm.cmd, and Node's
child_process.spawn cannot execute it directly:

  • spawn("npm", ...) -> ENOENT (bare npm is not an executable on Windows)
  • spawn("npm.cmd", ...) -> EINVAL on Node 24.18.0 (regression: .cmd files can no longer be spawned directly without a shell; Node 24.18 also rejects the shell:true-less .cmd spawn with EINVAL)

Empirical matrix (Node v24.18.0, win-x64):

call result
spawn("npm") ENOENT
spawn("npm.cmd") EINVAL
spawn("cmd.exe", ["/d","/s","/c","npm.cmd", ...]) works (npm 11.16.0, exit 0)
spawn(cmd, args, {shell:true}) works (deprecated)

Observed failure during node scripts/dev/cli.ts up --no-slack:

deps: fail -- npm install failed in .../plugins/web-ui: spawn npm ENOENT

Suggested fix (minimal, local)

In scripts/dev/lib/proc.ts, resolve the command against PATH on win32
(npm -> npm.cmd, tsx -> tsx.cmd, etc.) and spawn .cmd/.bat via
cmd.exe /d /s /c <resolved> <args...>; leave .exe/.com and non-Windows
behavior unchanged. This keeps a single spawn choke point and fixes both
deps.ts npm calls and any other bare-command child spawns on Windows.

Verified locally with this change: pool boot completes (deps: ok, children
core/web/admin/portal all ok) on Windows with Node 24.18.0.

Environment

  • OS: Windows 10/11 (NT 10.0.26200)
  • Node: v24.18.0 (official win-x64 build); npm 11.16.0
  • QM pin: b702813

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions