samedi 28 mars 2015

Node.js exec call never calls callback

I have a Node.js script which makes a call to exec but it never calls the callback. The code:



var exec = require('child_process').exec;
exec("{COMMAND} > results.log", function (error, stdout, stderr) {
console.log('callback called!'); // this never gets called.
});


I'm using async lib and I'm relying on the exec callback to be called so I can in turn call an async callback to continue execution flow. The command does indeed get executed, as I see the output to the results.log file. What am I doing wrong here?


Aucun commentaire:

Enregistrer un commentaire