From d9e93ad367865cf07cc6572d2827d3698d360101 Mon Sep 17 00:00:00 2001 From: Remy Sharp Date: Wed, 13 Dec 2017 21:08:33 +0000 Subject: [PATCH] fix: support node arguments again If node is being passed any arguments (before the script) then use spawn instead of fork. Fixes #1161 --- lib/monitor/run.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/monitor/run.js b/lib/monitor/run.js index 7b67b705..23b5106a 100644 --- a/lib/monitor/run.js +++ b/lib/monitor/run.js @@ -83,7 +83,13 @@ function run(options) { }); } - if (executable === 'node' && utils.version.major > 4) { + 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 && + executable === 'node' && + utils.version.major > 4 + ) { var forkArgs = cmd.args.slice(1); var env = utils.merge(options.execOptions.env, process.env); stdio.push('ipc');