From 7783ffac7f8d9d54bfc97dfd7a71a1c519e5fcd9 Mon Sep 17 00:00:00 2001 From: Murat Aslan Date: Tue, 10 Feb 2026 23:03:00 +0300 Subject: [PATCH] fix: allow pnpm command execution without .cmd extension on Windows in SpaProxy Previously, SpaProxyLaunchManager blindly appended .cmd extension to any command without an extension on Windows. This caused issues for tools installed as standalone executables (like pnpm.exe). This change restricts the forced .cmd extension behavior to only 'npm' and 'yarn', allowing 'pnpm' and other tools to be resolved correctly by the shell. Fixes #45700 --- src/Middleware/Spa/SpaProxy/src/SpaProxyLaunchManager.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Middleware/Spa/SpaProxy/src/SpaProxyLaunchManager.cs b/src/Middleware/Spa/SpaProxy/src/SpaProxyLaunchManager.cs index 68b990197bf5..3d4f0c4ecb08 100644 --- a/src/Middleware/Spa/SpaProxy/src/SpaProxyLaunchManager.cs +++ b/src/Middleware/Spa/SpaProxy/src/SpaProxyLaunchManager.cs @@ -180,7 +180,11 @@ private void LaunchDevelopmentProxy() // On windows we transform npm/yarn to npm.cmd/yarn.cmd so that the command // can actually be found when we start the process. This is overridable if // necessary by explicitly setting up the extension on the command. - command = $"{command}.cmd"; + if (string.Equals(command, "npm", StringComparison.OrdinalIgnoreCase) || + string.Equals(command, "yarn", StringComparison.OrdinalIgnoreCase)) + { + command = $"{command}.cmd"; + } } var info = new ProcessStartInfo(command, arguments)