error: This is probably not a problem with npm. There is likely additional logging output above

Total
0
Shares

In my project, I’m using Angular6 for the frontend. Now what I’m trying to do is deploy my project which is in remote server into the actual server. I’m using npm run build -prod command to build the frontend first. But I can’t build my project since the following error occurs again and again,

npm ERR! code ELIFECYCLE
npm ERR! errno 134
npm ERR! [email protected] build: `ng build --prod --build-optimizer --aot`
npm ERR! Exit status 134
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR!     C:UsersIndrajith.EAppDataRoamingnpm-cache_logs2019-08-22T08_41_00_271Z-debug.log

My error log in the C:UsersIndrajith.EAppDataRoamingnpm-cache_logs2019-08-22T08_41_00_271Z-debug.log file path contains the same error details mentioned above.

How can I resolve this problem?


Solution

Finally, I found a solution to this problem without reinstalling npm and I’m posting it because in future it will help someone,
Most of the time this error occurs javascript heap went out of the memory. As the error says itself this is not a problem with npm. Only we have to do is

instead of,

npm  run build -prod

extend the javascript memory by following,

node --max_old_space_size=4096 node_modules/@angular/cli/bin/ng build --prod

Source: StackOverflow.com

Leave a Reply

Your email address will not be published. Required fields are marked *