{"id":130,"hash":"f5e1eda6dfd29bb0f5a01ad2b11317837e843864b7cf2178da851addc2333bae","pattern":"The command &quot;npm run build -- --prod&quot; exited with code 1 error","full_message":"I'm developing an Asp.Net Core 2 and Angular 5 project in visual studio 2017.  \n\nWhen I'm going to publish my project then the error 'The command \"npm run build -- --prod\" exited with code 1' show in error list window.\n\nI created the project with Angular CLI in ASP.NET Core 2 Angular template\n link and everything was fine and the project run and publish correctly.\n\nAfter a while, I don't know what exactly happens that cause the project doesn't publish.   \n\nIn the npm-debug.log file \n\n0 info it worked if it ends with ok\n1 verbose cli [ 'C:\\\\Program Files\\\\nodejs\\\\node.exe',\n1 verbose cli   'C:\\\\Program Files\\\\nodejs\\\\node_modules\\\\npm\\\\bin\\\\npm-cli.js',\n1 verbose cli   'run',\n1 verbose cli   'build',\n1 verbose cli   '--',\n1 verbose cli   '--prod' ]\n2 info using npm@3.10.10\n3 info using node@v6.10.3\n4 verbose stack Error: ENOENT: no such file or directory, open 'C:\\Project\\JWS\\JWSApplication\\package.json'\n4 verbose stack     at Error (native)\n5 verbose cwd C:\\Project\\JWS\\JWSApplication\n6 error Windows_NT 10.0.15063\n7 error argv \"C:\\\\Program Files\\\\nodejs\\\\node.exe\" \"C:\\\\Program Files\\\\nodejs\\\\node_modules\\\\npm\\\\bin\\\\npm-cli.js\" \"run\" \"build\" \"--\" \"--prod\"\n8 error node v6.10.3\n9 error npm  v3.10.10\n10 error path C:\\Project\\JWS\\JWSApplication\\package.json\n11 error code ENOENT\n12 error errno -4058\n13 error syscall open\n14 error enoent ENOENT: no such file or directory, open 'C:\\Project\\JWS\\JWSApplication\\package.json'\n15 error enoent ENOENT: no such file or directory, open 'C:\\Project\\JWS\\JWSApplication\\package.json'\n15 error enoent This is most likely not a problem with npm itself\n15 error enoent and is related to npm not being able to find a file.\n16 verbose exit [ -4058, true ]","ecosystem":"npm","package_name":"angular","package_version":null,"solution":"Perform any of the following options as long as there is an error\n\nFor passing an argument to build command:\n\nchange 'npm run build -- --prod' to 'npm run build --prod' in the .csproj file     \n\nOpen ClientApp folder and Update project angular-cli with this CMD command:     \n\nnpm install --save-dev @angular/cli@latest\n\nUpdate visual studio NodeJS and npm from:\n\nTools > Options > Projects and Solutions > Web Package Management > External \n Web Tools\n\nIf NodeJS and npm aren't installed on your environment path Add NodeJS and npm folder to the top of the list else move $(path) to the top of the list\n\n.\n\nThank @Praveen Kumar and @Yerkon","confidence":0.95,"source":"stackoverflow","source_url":"https://stackoverflow.com/questions/49643536/the-command-npm-run-build-prod-exited-with-code-1-error","votes":53,"created_at":"2026-04-19T04:41:21.906507+00:00","updated_at":"2026-04-19T04:51:03.657876+00:00"}