abpframework / abp

Open-source web application framework for ASP.NET Core! Offers an opinionated architecture to build enterprise software solutions with best practices on top of the .NET. Provides the fundamental infrastructure, cross-cutting-concern implementations, startup templates, application modules, UI themes, tooling and documentation.
https://abp.io
GNU Lesser General Public License v3.0
12.76k stars 3.41k forks source link

ABP Studio CLI Failed to create a new project with blazor-server #20641

Closed s1092958 closed 2 weeks ago

s1092958 commented 2 weeks ago

Is there an existing issue for this?

Description

While abp new CLI Installing client side libraries will failed to start a process with file path 'pwsh' on Macbook Air M1 and Macbook Pro Intel processor. image As per error message below ✅ Installing client side libraries System.ComponentModel.Win32Exception: Failed to start a process with file path 'pwsh'. Target file or working directory doesn't exist, or the provided credentials are invalid. System.ComponentModel.Win32Exception: An error occurred trying to start process 'pwsh' with working directory '/Users/xxxx/Downloads/Tutorial/BookStore/src/BookStore.Blazor'. No such file or directory at bool System.Diagnostics.Process.ForkAndExecProcess(ProcessStartInfo startInfo, string resolvedFilename, string[] argv, string[] envp, string cwd, bool setCredentials, uint userId, uint groupId, uint[] groups , out int stdinFd, out int stdoutFd, out int stderrFd, bool usesTerminal, bool throwOnNoExec) at bool System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo) at void CliWrap.Utils.ProcessEx.Start() in /_/CliWrap/Utils/ProcessEx.cs:56 at void CliWrap.Utils.ProcessEx.Start() in /_/CliWrap/Utils/ProcessEx.cs:68 at CommandTask<CommandResult> CliWrap.Command.ExecuteAsync(CancellationToken forcefulCancellationToken, CancellationToken gracefulCancellationToken) in /_/CliWrap/Command.Execution.cs:307 at CommandTask<BufferedCommandResult> CliWrap.Buffered.BufferedCommandExtensions.ExecuteBufferedAsync(Command command, Encoding standardOutputEncoding, Encoding standardErrorEncoding, CancellationToken forcefulCancellationToken, CancellationToken gracefulCancellationToken) in /_/CliWrap/Buffered/ BufferedCommandExtensions.cs:43 at async Task Volo.Abp.Studio.Extensions.StandardTemplates.App.Steps.AppGenerateCertificateStep.JOMO9wQwwS( object , object ) at void Volo.Abp.Studio.Extensions.StandardTemplates.App.Steps.AppGenerateCertificateStep.<>c__DisplayClass0_0.tbgRB lqgAN3yWo8S8Jh.MoveNext() at void Volo.Abp.Studio.Cli.Services.CliAsyncTaskService.<>c__DisplayClass0_0.sqDtV2mleKHMyRSh5fR.MoveNext() at void Spectre.Console.Status.<>c__DisplayClass16_0.<<StartAsync>b__0>d.MoveNext() in /_/src/Spectre.Console/Live/Status/Status.cs:79 at void Spectre.Console.Status.<>c__DisplayClass17_01.<b0>d.MoveNext() in
/_/src/Spectre.Console/Live/Status/Status.cs:120
at void Spectre.Console.Progress.<>c__DisplayClass32_0`1.<b
0>d.MoveNext() in
//src/Spectre.Console/Live/Progress/Progress.cs:138
at async Task Spectre.Console.Internal.DefaultExclusivityMode.RunAsync(Func<Task> func) in
/
/src/Spectre.Console/Internal/DefaultExclusivityMode.cs:40
at async Task Spectre.Console.Progress.StartAsync(Func<ProgressContext, Task> action) in
//src/Spectre.Console/Live/Progress/Progress.cs:121
at async Task Spectre.Console.Status.StartAsync(string status, Func<StatusContext, Task> func) in
/
/src/Spectre.Console/Live/Status/Status.cs:117
at async Task Spectre.Console.Status.StartAsync(string status, Func<StatusContext, Task> action) in
//src/Spectre.Console/Live/Status/Status.cs:77
at async Task Volo.Abp.Studio.Cli.Services.CliAsyncTaskService.AddTaskAsync(AsyncTask asyncTask, string info,
Guid? taskModelId, bool isGlobal)
at async Task Volo.Abp.Studio.Extensions.StandardTemplates.App.Steps.AppGenerateCertificateStep.ExecuteAsync(
SolutionBuildPipelineContext context)
at async Task Volo.Abp.Studio.SolutionTemplates.Pipelines.PipelinedTemplateSolutionBuilderBase.ag72WyiVpS(
List , object )
at async Task Volo.Abp.Studio.SolutionTemplates.Pipelines.PipelinedTemplateSolutionBuilderBase.
BuildAsync(SolutionBuilderContext context)
at async Task Volo.Abp.Studio.SolutionTemplates.SolutionBuilder.BuildAsync(SolutionBuilderContext
context)
at async Task Volo.Abp.Studio.Cli.Commands.NewSolutionCommand.ExecuteAsync(CommandLineArgs commandLineArgs)
at async Task Volo.Abp.Studio.Cli.StudioCliService.RunInternalAsync(CommandLineArgs commandLineArgs)
at async Task Volo.Abp.Studio.Cli.StudioCliService.RunAsync(string[] args)
Unhandled exception. System.ComponentModel.Win32Exception (2): Failed to start a process with file path 'pwsh'. Target file or working directory doesn't exist, or the provided credentials are invalid. ---> System.ComponentModel.Win32Exception (2): An error occurred trying to start process 'pwsh' with working directory '/Users/xxxx/Downloads/Tutorial/BookStore/src/BookStore.Blazor'. No such file or directory at System.Diagnostics.Process.ForkAndExecProcess(ProcessStartInfo startInfo, String resolvedFilename, String[] argv, String[] envp, String cwd, Boolean setCredentials, UInt32 userId, UInt32 groupId, UInt32[] groups, Int32& stdinFd, Int32& stdoutFd, Int32& stderrFd, Boolean usesTerminal, Boolean throwOnNoExec) at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo) at CliWrap.Utils.ProcessEx.Start() in /
/CliWrap/Utils/ProcessEx.cs:line 56 at CliWrap.Utils.ProcessEx.Start() in //CliWrap/Utils/ProcessEx.cs:line 68 at CliWrap.Command.ExecuteAsync(CancellationToken forcefulCancellationToken, CancellationToken gracefulCancellationToken) in //CliWrap/Command.Execution.cs:line 307 at CliWrap.Buffered.BufferedCommandExtensions.ExecuteBufferedAsync(Command command, Encoding standardOutputEncoding, Encoding standardErrorEncoding, CancellationToken forcefulCancellationToken, CancellationToken gracefulCancellationToken) in /_/CliWrap/Buffered/BufferedCommandExtensions.cs:line 43 at Volo.Abp.Studio.Extensions.StandardTemplates.App.Steps.AppGenerateCertificateStep.JOMO9wQwwS(Object , Object ) at Volo.Abp.Studio.Extensions.StandardTemplates.App.Steps.AppGenerateCertificateStep.<>cDisplayClass0_0.tbgRBlqgAN3yWo8S8Jh.MoveNext() --- End of stack trace from previous location --- at Volo.Abp.Studio.Cli.Services.CliAsyncTaskService.<>c__DisplayClass0_0.sqDtV2mleKHMyRSh5fR.MoveNext() --- End of stack trace from previous location --- at Spectre.Console.Status.<>cDisplayClass16_0.<b0>d.MoveNext() in /_/src/Spectre.Console/Live/Status/Status.cs:line 79 --- End of stack trace from previous location --- at Spectre.Console.Status.<>c__DisplayClass17_0`1.<b0>d.MoveNext() in /_/src/Spectre.Console/Live/Status/Status.cs:line 120 --- End of stack trace from previous location --- at Spectre.Console.Progress.<>c__DisplayClass32_01.<<StartAsync>b__0>d.MoveNext() in /_/src/Spectre.Console/Live/Progress/Progress.cs:line 138 --- End of stack trace from previous location --- at Spectre.Console.Internal.DefaultExclusivityMode.RunAsync[T](Func1 func) in //src/Spectre.Console/Internal/DefaultExclusivityMode.cs:line 40 at Spectre.Console.Progress.StartAsync[T](Func`2 action) in //src/Spectre.Console/Live/Progress/Progress.cs:line 121 at Spectre.Console.Status.StartAsync[T](String status, Func2 func) in /_/src/Spectre.Console/Live/Status/Status.cs:line 117 at Spectre.Console.Status.StartAsync(String status, Func2 action) in /_/src/Spectre.Console/Live/Status/Status.cs:line 77 at Volo.Abp.Studio.Cli.Services.CliAsyncTaskService.AddTaskAsync(AsyncTask asyncTask, String info, Nullable1 taskModelId, Boolean isGlobal) at Volo.Abp.Studio.Extensions.StandardTemplates.App.Steps.AppGenerateCertificateStep.ExecuteAsync(SolutionBuildPipelineContext context) at Volo.Abp.Studio.SolutionTemplates.Pipelines.PipelinedTemplateSolutionBuilderBase.ag72WyiVpS(List1 , Object ) at Volo.Abp.Studio.SolutionTemplates.Pipelines.PipelinedTemplateSolutionBuilderBase.BuildAsync(SolutionBuilderContext context) at Volo.Abp.Studio.SolutionTemplates.SolutionBuilder.BuildAsync(SolutionBuilderContext context) at Volo.Abp.Studio.Cli.Commands.NewSolutionCommand.ExecuteAsync(CommandLineArgs commandLineArgs) at Volo.Abp.Studio.Cli.StudioCliService.RunInternalAsync(CommandLineArgs commandLineArgs) at Volo.Abp.Studio.Cli.StudioCliService.RunAsync(String[] args) at Volo.Abp.Studio.Cli.Program.x2J81t685(Object ) at Volo.Abp.Studio.Cli.Program.

(String[] args) zsh: abort abp new BookStore -u blazor-server -dbms SQLite -m none --theme leptonx-lite`

Reproduction Steps

  1. This is my dotnet version and I install it by brew image
  2. This is my Abp Studio Cli version 截圖 2024-08-27 11 47 13
  3. Follow the latest CLI command to create ABP project image
  4. Error occurs image

Expected behavior

No response

Actual behavior

No response

Regression?

No response

Known Workarounds

No response

Version

0.7.8

User Interface

Blazor Server

Database Provider

EF Core (Default)

Tiered or separate authentication server

Tiered

Operation System

macOS

Other information

No response

maliming commented 2 weeks ago

Failed to start a process with file path 'pwsh'.

Can you try to install the power shell in your MacOS?

https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-macos?view=powershell-7.4

s1092958 commented 2 weeks ago

Yup. There is the PowerShell issue. image Thank you @maliming .