~/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
Last active
August 29, 2015 14:14
-
-
Save hail2u/d8896c857278acc1b4d3 to your computer and use it in GitHub Desktop.
3rd `spawnSync()` with shared `options` argument throws exception
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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