Skip to content

Instantly share code, notes, and snippets.

@hail2u hail2u/output.md
Last active Aug 29, 2015

Embed
What would you like to do?
3rd `spawnSync()` with shared `options` argument throws exception
~/Desktop $ node test.js
desktop.ini  test.js
desktop.ini  test.js
child_process.js:905
      throw new TypeError('Incorrect value for stdio stream: ' +
            ^
TypeError: Incorrect value for stdio stream: { type: 'fd', fd: { type: 'fd', fd: 0 } }
    at child_process.js:905:13
    at Array.reduce (native)
    at _validateStdio (child_process.js:829:17)
    at spawnSync (child_process.js:1251:19)
    at Object.<anonymous> (c:\Users\Kyo\Desktop\test.js:13:10)
    at Module._compile (module.js:446:26)
    at Object.Module._extensions..js (module.js:464:10)
    at Module.load (module.js:341:32)
    at Function.Module._load (module.js:296:12)
    at Function.Module.runMain (module.js:487:10)
~/Desktop $ node test2.js
desktop.ini  test.js
desktop.ini  test.js
desktop.ini  test.js
#!/usr/bin/env node
'use strict';
var spawn = require('child_process').spawnSync;
var ls;
var opts = {
stdio: 'inherit'
};
ls = spawn('ls', [], opts);
ls = spawn('ls', [], opts);
ls = spawn('ls', [], opts);
#!/usr/bin/env node
'use strict';
var spawn = require('child_process').spawnSync;
var ls;
ls = spawn('ls', [], {
stdio: 'inherit'
});
ls = spawn('ls', [], {
stdio: 'inherit'
});
ls = spawn('ls', [], {
stdio: 'inherit'
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.