node.js child_process.spawn no stdout unless 'inherit'
I'm trying to capture the stdout from a spawn ed child_process in node.js (0.10.29). Right now I'm just trying with ping The following code doesn't print (but does ping) var exec = require('child_process').exec; var spawn = require('child_process').spawn; var util = require('util') var ping = spawn('ping', ['127.0.0.1'], {stdio: 'pipe'}); ping.stdout.on('data', function(data){ util.print(data); }) ping.stderr.on('data', function(data){ util.print(data); }) If I change stdio: 'pipe' to stdio: 'inherit' and get rid of the stdout/stderr hooks like so: var ping = spawn('ping', ['127.0.0.2'],