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