From 0d9a89241c58e470125e4358fcb0ba25f2962bb5 Mon Sep 17 00:00:00 2001 From: Remy Sharp Date: Thu, 28 Dec 2017 20:16:30 +0000 Subject: [PATCH] fix: don't use fork with `node inspect` Fixes: #1191 --- lib/monitor/run.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/monitor/run.js b/lib/monitor/run.js index cc149131..ba5c2e32 100644 --- a/lib/monitor/run.js +++ b/lib/monitor/run.js @@ -78,10 +78,13 @@ function run(options) { }); } + const firstArg = cmd.args[0] || ''; + if ( // this is a hack to avoid forking if there's a node argument being passed // it's a short term fix, and I'm not 100% sure that `fork` is the right way - (cmd.args[0] || '').indexOf('-') === -1 && + firstArg.indexOf('-') === -1 && + firstArg !== 'inspect' && executable === 'node' && utils.version.major > 4 ) {