I have installed io.js, and start testing spawnSync(). However, calling spawnSync() 3 times with shared options argument throws an error.
test.js:
var spawn = require('child_process').spawnSync;
var ls;
var opts = {
stdio: 'inherit'
};
ls = spawn('ls', [], opts);
ls = spawn('ls', [], opts);
ls = spawn('ls', [], opts);
Then run:
C:\Users\Kyo\Desktop>iojs 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)
Tested on io.js v1.0.3 (Win64) on Windows 7 (64bit).
I have installed io.js, and start testing
spawnSync(). However, callingspawnSync()3 times with sharedoptionsargument throws an error.test.js:Then run:
Tested on io.js v1.0.3 (Win64) on Windows 7 (64bit).