From 10cee0668b1444992bf9c82f54547b2e0b873a3b Mon Sep 17 00:00:00 2001 From: ehmicky Date: Fri, 3 Apr 2020 19:06:13 +0200 Subject: [PATCH] fix(core): fix worker threads in Node >=11.10.0 --- lib/util/resolveCommand.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/util/resolveCommand.js b/lib/util/resolveCommand.js index c46d8d7..6825a8b 100644 --- a/lib/util/resolveCommand.js +++ b/lib/util/resolveCommand.js @@ -8,7 +8,7 @@ function resolveCommandAttempt(parsed, withoutPathExt) { const cwd = process.cwd(); const hasCustomCwd = parsed.options.cwd != null; // Worker threads do not have process.chdir() - const shouldSwitchCwd = hasCustomCwd && process.chdir !== undefined; + const shouldSwitchCwd = hasCustomCwd && process.chdir !== undefined && !process.chdir.disabled; // If a custom `cwd` was specified, we need to change the process cwd // because `which` will do stat calls but does not support a custom cwd