Angular-cli AOT构建失败,并显示“致命错误:CALL_AND_RETRY_LAST分配失败-JavaScript堆内存不足". [英] Angular-cli AOT build fails with "FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory"

查看:92
本文介绍了Angular-cli AOT构建失败,并显示“致命错误:CALL_AND_RETRY_LAST分配失败-JavaScript堆内存不足".的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用AOT构建我的angular-cli项目

I am trying to build my angular-cli project with AOT

ng build --aot

但失败并显示错误

致命错误:CALL_AND_RETRY_LAST分配失败-JavaScript堆内存不足"

"FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory"

如果我使用--prod标志进行构建,也会发生同样的事情.

The same thing happens if I build with the --prod flag.

有什么主意吗?

推荐答案

在github上已经存在一个问题: https://github.com/angular/angular-cli/issues/5618

There is already an issue opened on github: https://github.com/angular/angular-cli/issues/5618

同时,作为一种解决方法,您可以尝试指定max_old_space_size设置(以MB为单位)

Meanwhile, as a workaround, you can try specifying the max_old_space_size setting (in MB)

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

这篇关于Angular-cli AOT构建失败,并显示“致命错误:CALL_AND_RETRY_LAST分配失败-JavaScript堆内存不足".的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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