diff --git a/lib/monitor/run.js b/lib/monitor/run.js index c36dd7c..ed48f02 100644 --- a/lib/monitor/run.js +++ b/lib/monitor/run.js @@ -12,7 +12,8 @@ var utils = require('../utils'), noop = function() {}, restart = null, psTree = require('ps-tree'), - nodeMajor = parseInt((process.versions.node.split('.') || [null,null])[1] || 0, 10), + nodeMajor = parseInt((process.versions.node.split('.') || [null,null])[0] || 0, 10), + nodeMinor = parseInt((process.versions.node.split('.') || [null,null])[1] || 0, 10), hasPS = true; // discover if the OS has `ps`, and therefore can use psTree @@ -57,7 +58,9 @@ function run(options) { var args = [cmd.executable].concat(cmd.args).join(' ').trim(); var spawnArgs = [sh, [shFlag, args]]; - if (nodeMajor >= 8) { + if (nodeMajor === 0 && nodeMinor < 8) { + // use the old spawn args :-\ + } else { spawnArgs.push({ env: utils.merge(options.execOptions.env, process.env), stdio: stdio