error solved

Solve – the command npm exited with code 1


In this article, you will learn how to solve the command npm exited with code 1 error.

In order to solve the error you can follow the steps below:

Make the changes in in the .csproj file like below:

npm run build -- --prod // change this command

to

npm run build --prod

Now, Open Project folder and Update project angular-cli with this CMD command:

npm install --save-dev @angular/cli@latest

and finally, Update visual studio NodeJS and npm by navigating to following settings.

Tools > Options > Projects and Solutions > Web Package Management > External
Web Tools

If above solution doesn’t solve the issue. You can navigate to Visual Studio -> Tools -> Options -> Projects and Solutions -> Build and Run -> MSBuild project build output verbosity. Change it to Detailed.

Then, when you try to debug the project, in the Output window, You will get the Real cause of the error.


Share on social media

//