Bruno Camarneiro
Bruno Camarneiro

Reputation: 555

nodejs ENOENT after update

I've updated nodejs from v.0.10.26 to v.0.10.28 and suddently this piece of code:

// Start slave process
var process = require('child_process');
var ls = process.exec('node slave.js', function (error, stdout, stderr) {
    if (error) {
        console.log(error.stack);
        console.log('Error code: '+error.code);
        console.log('Signal received: '+error.signal);
        console.log('stdout: ' + stdout);
        console.log('stderr: ' + stderr);
    }
    else{
        console.log('ok!');
    }

});

started to dump this error to the console:

Error: spawn ENOENT
    at errnoException (child_process.js:998:11)
    at Process.ChildProcess._handle.onexit (child_process.js:789:34)
Error code: ENOENT
Signal received: undefined
stdout:
stderr:

I'm running Windows 8.1 x64. I've tryied to find a solution this entire morning and can't find what is causing this.

EDIT 1

slave.js is in the same directory as the main file.

EDIT 2

Just to be sure that node could find 'slave.js', I used this code:

fs.exists('slave.js', function(exists) {
    if (exists) {
        console.log('It exists!');
    }
});

And yes, Node says that the file exists.

EDIT 3 Reverted to node 0.10.26. Same issue. I've downgraded from Python 3 to 2.7. Can this be related?

Upvotes: 0

Views: 417

Answers (1)

dylants
dylants

Reputation: 23380

Maybe it's not the slave.js file which can not be found, but node itself. Try checking your path to see if node remains in the path following the upgrade.

Upvotes: 1

Related Questions