错误:这可能不是npm的问题.上面可能还有其他日志记录输出

编程入门 行业动态 更新时间:2024-10-26 22:27:13
本文介绍了错误:这可能不是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的问题.上面可能还有其他日志记录输出

本文发布于:2023-08-04 03:23:38,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1292436.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:这可   错误   日志   npm

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!