diff --git a/lib/monitor/run.js b/lib/monitor/run.js index ba5c2e32..0e9a6440 100644 --- a/lib/monitor/run.js +++ b/lib/monitor/run.js @@ -67,7 +67,6 @@ function run(options) { var args = runCmd ? utils.stringify(executable, cmd.args) : ':'; var spawnArgs = [sh, [shFlag, args]]; - debug('spawning', args); if (utils.version.major === 0 && utils.version.minor < 8) { // use the old spawn args :-\ @@ -95,10 +94,15 @@ function run(options) { env: env, stdio: stdio, }); + utils.log.detail('forking'); + debug(forkArgs); } else { + utils.log.detail('spawning'); child = spawn.apply(null, spawnArgs); + debug(spawnArgs); } + if (config.required) { var emit = { stdout: function (data) { @@ -257,6 +261,10 @@ function run(options) { process.stdin.resume(); // FIXME decide whether or not we need to decide the encoding // process.stdin.setEncoding('utf8'); + + // swallow the stdin error if it happens + // ref: https://github.com/remy/nodemon/issues/1195 + child.stdin.on('error', () => {}); process.stdin.pipe(child.stdin); bus.once('exit', function () {