I use the following code to excute command from node application and this is working...The problem is when there is error I dont get it,I try to debug the code and I when I put break-point in the if(error) It doesnt stops ,any idea why?
var exec = require('child_process').exec;
var cmd = 'npm install winston --save';
exec(cmd, function(error, stdout, stderr) {
if(error){
console.log(error);
}
});