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

查看:38
本文介绍了错误:这可能不是 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:UsersIndrajith.EAppDataRoaming
pm-cache\_logs2019-08-22T08_41_00_271Z-debug.log

我在 C:UsersIndrajith.EAppDataRoaming pm-cache\_logs2019-08-22T08_41_00_271Z-debug.log 文件路径中的错误日志包含相同的错误详细信息上面提到了.

My error log in the C:UsersIndrajith.EAppDataRoaming pm-cache\_logs2019-08-22T08_41_00_271Z-debug.log file path contains the same error details mentioned above.

我该如何解决这个问题?

How can I resolve this problem?

推荐答案

最后,我在不重新安装 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天全站免登陆