3

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.

Chris
  • 5,876
  • 3
  • 43
  • 69
  • try the procedure at http://stackoverflow.com/questions/27688804/how-to-debug-any-node-js-child-process-error-spawn-enoent – laconbass Dec 29 '14 at 13:30
  • I have the same problem. It used to work in node 0.10, it seems to fail with node 0.12. Which version of node are you using? – Luis Crespo Feb 17 '15 at 15:22

0 Answers0