错误:这可能不是npm的问题.上面可能还有其他日志记录输出 [英] error: This is probably not a problem with npm. There is likely additional logging output above

查看:461
本文介绍了错误:这可能不是npm的问题.上面可能还有其他日志记录输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的项目中,我使用Angular6作为前端.现在,我想做的是将远程服务器中的项目部署到实际服务器中.我正在使用npm run build -prod命令首先构建前端.但是我无法建立我的专案,因为一次又一次地发生以下错误,

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! Trackit-Revamp@6.0.0 build: `ng build --prod --build-optimizer --aot`
npm ERR! Exit status 134
npm ERR!
npm ERR! Failed at the Trackit-Revamp@6.0.0 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:\Users\Indrajith.E\AppData\Roaming\npm-cache\_logs\2019-08-22T08_41_00_271Z-debug.log

我在C:\Users\Indrajith.E\AppData\Roaming\npm-cache\_logs\2019-08-22T08_41_00_271Z-debug.log文件路径中的错误日志中包含与上述相同的错误详细信息.

My error log in the C:\Users\Indrajith.E\AppData\Roaming\npm-cache\_logs\2019-08-22T08_41_00_271Z-debug.log file path contains the same error details mentioned above.

如何解决此问题?

推荐答案

最后,我找到了一个无需重新安装npm即可解决此问题的解决方案,我正在发布它,因为将来它将对某人有所帮助, 大多数情况下,会发生此错误,而javascript堆会耗尽内存.正如错误本身所言,这不是npm的问题.唯一需要做的就是

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

而不是

npm  run build -prod

通过以下方式扩展javascript内存,

extend the javascript memory by following,

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

这篇关于错误:这可能不是npm的问题.上面可能还有其他日志记录输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆