I was debugging WebDriverJs in Windows today, and ran into an error that I traced down to spawning Java:
var spawn = require('child_process').spawn;
spawn('java');
The end error is as follows:
Error: spawn ENOENT
at errnoException (child_process.js:980:11)
at Process.ChildProcess._handle.onexit (child_process.js:771:34)
java.exe is in C:\Windows\System32\, and C:\Windows\System32 is in path (and the path in Node correctly includes it). Trying the full path to Java didn't seem to work either.
What's going on? spawn('node')
, as a counter-example, doesn't fail. Java prints out something when I type it from the command line.