diff --git a/lib/monitor/run.js b/lib/monitor/run.js index e316c2b1..4c74d338 100644 --- a/lib/monitor/run.js +++ b/lib/monitor/run.js @@ -91,7 +91,7 @@ function run(options) { const shouldFork = !config.options.spawn && !inBinPath && - firstArg.indexOf('-') === -1 && // don't fork if there's a node exec arg + !(firstArg.indexOf('-') === 0) && // don't fork if there's a node exec arg firstArg !== 'inspect' && // don't fork it's `inspect` debugger executable === 'node' && // only fork if node utils.version.major > 4 // only fork if node version > 4