Friday 9 June 2017

Running Node.js command produces no output and does not exit

so the following code isnt working for the ping command. Any suggestions?

var target = "8.8.8.8";
var exec = require('child_process').exec;
function puts(error, stdout, stderr) { console.log(stdout) }
exec("ping 8.8.8.8", puts);

Thanks guys!



via David Walser

No comments:

Post a Comment