ProjectStack
npm

Error: spawn ENOENT

Node.js tried to spawn a child process (run an external command) but couldn't find the executable. The command doesn't exist in the system PATH or the binary isn't installed.

Common causes

  • The CLI tool or binary isn't installed on the system
  • The tool is installed locally in node_modules but the path isn't set correctly
  • A typo in the command name being passed to spawn/exec
  • On Windows, the command exists but uses a different extension (.cmd, .bat)

How to fix it

  1. Install the missing tool globally: npm install -g <tool-name>
  2. For locally installed binaries, use npx: npx <command> instead of spawning directly
  3. Verify the command exists: which <command> (Mac/Linux) or where <command> (Windows)
  4. On Windows, ensure you're using the .cmd extension or using cross-spawn package for cross-platform compatibility

Example

Error: spawn git ENOENT at ChildProcess._handle.onexit (node:internal/child_process:285:19) at onErrorNT (node:internal/child_process:483:16) { errno: -2, code: 'ENOENT', syscall: 'spawn git'

A Node.js script calling child_process.spawn('git', ...) on a machine where git isn't installed

Have a different error?

Paste any error message into the Error Translator to get an instant explanation.