dotnet / aspnetcore

ASP.NET Core is a cross-platform .NET framework for building modern cloud-based web applications on Windows, Mac, or Linux.
https://asp.net
MIT License
35.49k stars 10.04k forks source link

Default ASP.NET 7 React SPA template can't start SPA server without PowerShell #46726

Open leandrobueno opened 1 year ago

leandrobueno commented 1 year ago

Is there an existing issue for this?

Describe the bug

I've created a sample template using dotnet new react and when trying to run it using dotnet run I get an error saying:

fail: Microsoft.AspNetCore.SpaProxyLaunchManager[0]
      Failed to launch the SPA development server 'npm start'.
      System.ComponentMomdel.Win32Exception (1260): An error occurred trying to start process 'powershell.exe' with working directory 'c:/foo/bar/'. This program is blocked by a group policy.

Indeed, PowerShell is blocked on my work machine, and I can only use cmd.exe.

Expected Behavior

Be able to choose between cmd.exe, PowerShell or another CLI when using SPA Development Server.

Steps To Reproduce

Create a template with dotnet new react. Have PowerShell blocked by a group policy in the machine. Try to run the application.

Exceptions (if any)

No response

.NET Version

7.0.102

Anything else?

No response

ghost commented 1 year ago

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

javiercn commented 1 year ago

The relevant code is here

If you want to provide a cmd friendly implementation, we would be open to accept a contribution.

Otherwise, the recommendation if powershell is blocked in your environment is to launch the SPA proxy manually.