Plexus icon indicating copy to clipboard operation
Plexus copied to clipboard

[Bug]: Start Error,spawn("npm", ...) has error

Open amerina opened this issue 3 months ago • 2 comments

Image Image

amerina avatar Sep 02 '26 07:09 amerina

I Use Codex fix the bug every reinstall time

amerina avatar Sep 02 '26 07:09 amerina

Fixed in v0.0.16 — after updating ( added 182 packages in 15s

95 packages are looking for funding run npm fund for details) no manual patching is needed anymore.

Root cause: plexus start spawned npm directly. On Windows, npm is an npm.cmd shim that Node's spawn() cannot execute, hence spawn npm ENOENT — your nvm4w environment made it very visible. Your second screenshot had the right diagnosis.

What changed:

  • The CLI now resolves next/dist/bin/next from the dashboard directory and spawns it with the current Node binary directly — no npm, no .cmd shim, no shell on any platform
  • plexus start 7778 (positional port) is honored now — your log showed it silently falling back to 7777
  • Spawn failures print a clean error instead of the unhandled 'error' stack

Regression tests now pin this contract (the spawn command must be process.execPath, never npm), so it cannot silently come back.

Thanks for the detailed report and the Codex-assisted root-cause analysis — it made the fix straightforward.

miniLV avatar Sep 02 '26 12:09 miniLV