Skip to content

fix: Allow pnpm execution without .cmd extension on Windows in SpaProxy#65386

Open
murataslan1 wants to merge 1 commit intodotnet:mainfrom
murataslan1:fix/pnpm-support-spaproxy
Open

fix: Allow pnpm execution without .cmd extension on Windows in SpaProxy#65386
murataslan1 wants to merge 1 commit intodotnet:mainfrom
murataslan1:fix/pnpm-support-spaproxy

Conversation

@murataslan1
Copy link

Description

This PR addresses issue #45700 by modifying SpaProxyLaunchManager to avoid blindly appending the .cmd extension to the launch command on Windows if it is not npm or yarn.

Problem

Previously, any launch command without an extension on Windows would have .cmd appended to it. This prevented tools installed as standalone executables (such as pnpm.exe) from being launched correctly, as the system would look for pnpm.cmd which might not exist or be the intended target.

Solution

The logic has been updated to only append .cmd for npm and yarn commands (maintaining backward compatibility and typical Windows behavior for these tools). For other commands, such as pnpm, the extension is not forced, allowing Process.Start with UseShellExecute = true to resolve the executable from PATH correctly (finding .exe, .cmd, .bat, etc.).

Fixes #45700

…n 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 dotnet#45700
Copilot AI review requested due to automatic review settings February 10, 2026 20:04
@github-actions github-actions bot added the needs-area-label Used by the dotnet-issue-labeler to label those issues which couldn't be triaged automatically label Feb 10, 2026
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Feb 10, 2026
@dotnet-policy-service
Copy link
Contributor

Thanks for your PR, @@murataslan1. Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates SpaProxy’s Windows command resolution so that SpaProxyLaunchCommand can run standalone executables like pnpm.exe without SpaProxy incorrectly forcing a .cmd extension.

Changes:

  • On Windows, append .cmd only when the launch tool is npm or yarn (case-insensitive).
  • Preserve existing override behavior when the user explicitly provides an extension (via Path.HasExtension(command)).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-contribution Indicates that the PR has been added by a community member needs-area-label Used by the dotnet-issue-labeler to label those issues which couldn't be triaged automatically

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support pnpm that installed using a standalone script in SpaProxyLaunchCommand

1 participant