Create new solution/project, choose Angular and run the project.
Error >
An unhandled exception occurred while processing the request.
AggregateException: One or more errors occurred. (One or more errors occurred. (Failed to start 'npm'. To resolve this:.
[1] Ensure that 'npm' is installed and can be found in one of the PATH directories.
Current PATH enviroment variable is: C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files (x86)ATI TechnologiesATI.ACE\Core-Static;C:\Program Files\Microsoft SQL Server130\Tools\Binn\;C:\Program Files\dotnet\;C:\Program Files\Microsoft VS Code\bin;C:\Program Files (x86)\dotnet\;C:\Program Files\Git\cmd;C:\Program Files\TortoiseSVN\bin;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server110\Tools\Binn\;C:\Program Files (x86)\Microsoft SDKs\TypeScript1.0\;C:\Program Files\Microsoft SQL Server120\Tools\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC110\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server120\Tools\Binn\;C:\Program Files\Microsoft SQL Server120\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server120\Tools\Binn\ManagementStudio\;C:\Program Files (x86)\Microsoft SQL Server120\DTS\Binn\;C:\Program Files\nodejs\;C:\Program Files\TortoiseGit\bin;C:\Users\SQAppData\Local\Microsoft\WindowsApps;C:\Users\SQAppData\Local\Programs\Fiddler;C:\Users\SQAppData\Roaming\npm;C:\Users\SQ.dotnet\tools;C:\Users\SQ.nuget\packages\runtime.win-x64.microsoft.netcore.app\3.0.0-preview-27122-01\tools;C:\Program Files\dotnet\sdk\NuGetFallbackFolder\newtonsoft.json\9.0.1\tools;C:\Users\SQ.nuget\packages\hangfire.sqlserver1.7.0-beta2\tools;C:\Users\SQ.nuget\packages\microsoft.entityframeworkcore.tools\3.0.0-preview.19074.3\tools
Make sure the executable is in one of those directories, or update your PATH.
[2] See the InnerException for further details of the cause.))
System.Threading.Tasks.Task.ThrowIfExceptional(bool includeTaskCanceledExceptions)
InvalidOperationException: Failed to start 'npm'. To resolve this:.
[1] Ensure that 'npm' is installed and can be found in one of the PATH directories.
Current PATH enviroment variable is: C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files (x86)ATI TechnologiesATI.ACE\Core-Static;C:\Program Files\Microsoft SQL Server130\Tools\Binn\;C:\Program Files\dotnet\;C:\Program Files\Microsoft VS Code\bin;C:\Program Files (x86)\dotnet\;C:\Program Files\Git\cmd;C:\Program Files\TortoiseSVN\bin;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server110\Tools\Binn\;C:\Program Files (x86)\Microsoft SDKs\TypeScript1.0\;C:\Program Files\Microsoft SQL Server120\Tools\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC110\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server120\Tools\Binn\;C:\Program Files\Microsoft SQL Server120\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server120\Tools\Binn\ManagementStudio\;C:\Program Files (x86)\Microsoft SQL Server120\DTS\Binn\;C:\Program Files\nodejs\;C:\Program Files\TortoiseGit\bin;C:\Users\SQAppData\Local\Microsoft\WindowsApps;C:\Users\SQAppData\Local\Programs\Fiddler;C:\Users\SQAppData\Roaming\npm;C:\Users\SQ.dotnet\tools;C:\Users\SQ.nuget\packages\runtime.win-x64.microsoft.netcore.app\3.0.0-preview-27122-01\tools;C:\Program Files\dotnet\sdk\NuGetFallbackFolder\newtonsoft.json\9.0.1\tools;C:\Users\SQ.nuget\packages\hangfire.sqlserver1.7.0-beta2\tools;C:\Users\SQ.nuget\packages\microsoft.entityframeworkcore.tools\3.0.0-preview.19074.3\tools
Make sure the executable is in one of those directories, or update your PATH.
[2] See the InnerException for further details of the cause.
Microsoft.AspNetCore.NodeServices.Npm.NpmScriptRunner.LaunchNodeProcess(ProcessStartInfo startInfo)
Host (useful for support):
Version: 3.0.0-preview-27122-01
Commit: 00c5c8bc40
Thanks for contacting us, @blahblehblah.
@ryanbrandenburg, can you please look into this? Thanks!
Did you confirm that NPM is installed and on the PATH? If you have done that the next thing to do is it open the "InnerException" to get further details. As I go in to here this message can be misleading because sometimes the source of this problem is not npm not being installed.
Let us know how that shakes out and we can go from there.
No response here so I'm closing this out. If you're still experiencing this we can re-open.
@ryanbrandenburg thanks for that link. Changing
spa.Options.SourcePath = "ClientApp";
to
spa.Options.SourcePath = Path.Join(env.ContentRootPath, "ClientApp");
worked perfectly!
Most helpful comment
@ryanbrandenburg thanks for that link. Changing
spa.Options.SourcePath = "ClientApp";to
spa.Options.SourcePath = Path.Join(env.ContentRootPath, "ClientApp");worked perfectly!