角度 CLI AOT 构建失败,"FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory"



>我正在尝试使用 AOT 构建我的角度 cli 项目

ng build --aot

但它因错误而失败

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

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

知道吗?

github上已经打开了一个问题:https://github.com/angular/angular-cli/issues/5618

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

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

npm install

node --max_old_space_size=8048 ./node_modules/@angular/cli/bin/ng serve

相关内容

最新更新