events.js:72
throw er; // Unhandled 'error' event
^
Error: spawn ENOENT
at errnoException (child_process.js:1000:11)
at Process.ChildProcess._handle.onexit (child_process.js:791:34)
Author note: Lots of issues with this error encouraged me to post this question for future references.
Related questions:
child_process.spawn
, Credits to @jiaji-zhou. Simple, quick, January 2015Environment issues
PATH
environment variable.Windows-only bugs/quirks
Wrong spawn('command', ['--argument', 'list'], { cwd, env, ...opts })
usage
opts.cwd
) does not exist · see leeroy-brun's answerString
spawn('command --wrong --argument list')
spawn('ENV_VAR=WRONG command')
Array
specified as String
spawn('cmd', '--argument list')
PATH
env variable spawn('cmd', [], { env: { variable } }
spawn('cmd', [], { env: { ...process.env, variable } }
There are 2 posible origins for
ENOENT
:
- Code you are writing
- Code you depend on
When origin is code you depend on, usual cause is an Environment Issue (or windows quirk)