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
- Install the missing tool globally: npm install -g <tool-name>
- For locally installed binaries, use npx: npx <command> instead of spawning directly
- Verify the command exists: which <command> (Mac/Linux) or where <command> (Windows)
- 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.
