From ec27452cb073c883fe3dd3f2c8a5a02a51574f62 Mon Sep 17 00:00:00 2001 From: Joel Pelaez Jorge Date: Tue, 19 Mar 2024 13:46:43 -0500 Subject: [PATCH] fix(core): override Path env variable on Windows platform (#22382) --- packages/nx/src/executors/run-commands/run-commands.impl.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/nx/src/executors/run-commands/run-commands.impl.ts b/packages/nx/src/executors/run-commands/run-commands.impl.ts index a23b24a056ca51..384303ccddb5ae 100644 --- a/packages/nx/src/executors/run-commands/run-commands.impl.ts +++ b/packages/nx/src/executors/run-commands/run-commands.impl.ts @@ -436,7 +436,9 @@ function processEnv(color: boolean, cwd: string, env: Record) { ...localEnv, ...env, }; - res.PATH = localEnv.PATH; // need to override PATH to make sure we are using the local node_modules + // need to override PATH to make sure we are using the local node_modules + if (localEnv.PATH) res.PATH = localEnv.PATH; // UNIX-like + if (localEnv.Path) res.Path = localEnv.Path; // Windows if (color) { res.FORCE_COLOR = `${color}`;