From 6c5b4f015814a6c4f6b33230dfd1a860aedc0aaf Mon Sep 17 00:00:00 2001 From: ehmicky Date: Sat, 4 Apr 2020 03:32:09 +0200 Subject: [PATCH] fix: fix worker threads in Node >=11.10.0 (#132) --- 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