Support pnpm that installed using a standalone script in SpaProxyLaunchCommand
- Dominant language
- C#
- Stars
- 38.4k
- Forks
- 10.9k
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 276
Description
Given a ASP.NET project with SPA setup:
```xml
client-app\
$(DefaultItemExcludes);$(SpaRoot)node_modules\**
https://localhost:5173
pnpm dev
```
`SpaProxyLaunchManager` failes to launch SPA development server, saying it cannot find 'pnpm.cmd':
```
info: Microsoft.AspNetCore.SpaProxy.SpaProxyLaunchManager[0]
No SPA development server running at https://localhost:5173 found.
fail: Microsoft.AspNetCore.SpaProxy.SpaProxyLaunchManager[0]
Failed to launch the SPA development server 'pnpm dev'.
System.ComponentModel.Win32Exception (2): An error occurred trying to start process 'pnpm.cmd' with working directory 'C:\project\client-app\'. 지정된 파일을 찾을 수 없습니다.
at System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
at Microsoft.AspNetCore.SpaProxy.SpaProxyLaunchManager.LaunchDevelopmentProxy()
fail: Microsoft.AspNetCore.SpaProxy.SpaProxyLaunchManager[0]
Couldn't start the SPA development server with command 'pnpm dev'.
info: Microsoft.AspNetCore.SpaProxy.SpaProxyMiddleware[0]
SPA proxy is not ready. Returning temporary landing page.
```
It makes sense because, using a [pnpm installation standalone script](https://pnpm.io/installation#on-windows), we do not have `pnpm.cmd`, but only `pnpm.exe` at `%localappdata%\pnpm\`.
I know I can use pnpm modifying `SpaProxyLaunchCommand` to have the extension like `pnpm.exe dev`,
https://github.com/dotnet/aspnetcore/blob/589aa11b5c631ce719e0530d66be8324a6d79169/src/Middleware/Spa/SpaProxy/src/SpaProxyLaunchManager.cs#L169-L174
but it would be great if we could omit it.
Contributor guide
Assessment
This issue has not been assessed yet.