Skip to content

Instantly share code, notes, and snippets.

@FooBarWidget
Created May 11, 2011 08:49
Show Gist options
  • Save FooBarWidget/966129 to your computer and use it in GitHub Desktop.
Save FooBarWidget/966129 to your computer and use it in GitHub Desktop.
var child_process = require('child_process');
var child = child_process.spawn('ls', ['.']);
child.stdin.end();
child.stdout.pipe(process.stdout);
child.stderr.pipe(process.stderr);
child.on('exit', function() {
console.log("Child exited");
});
node.js:181
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: Socket is not writable
at WriteStream._writeOut (net.js:392:11)
at WriteStream.write (net.js:378:17)
at Object.<anonymous> (console.js:61:18)
at ChildProcess.<anonymous> (/Users/hongli/foo.js:7:10)
at ChildProcess.emit (events.js:67:17)
at Socket.<anonymous> (child_process.js:179:12)
at Socket.emit (events.js:81:20)
at Array.<anonymous> (net.js:834:12)
at EventEmitter._tickCallback (node.js:173:26)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment