离子cordova构建android --prod时出错 [英] Error in ionic cordova build android --prod
问题描述
致命错误:CALL_AND_RETRY_LAST分配失败 - JavaScript堆内存不足
运行命令时出错: ionic cordova build android - -prod
注意: 离子生成android ,离子运行android 和离子服务一切正常。
我读过许多话题,说一旦项目变大,就会停止工作。
它在问题到来前一天工作。它停止了工作,因为我们添加了更多文件和JSON,用于多语言的应用程序翻译。
这是一个已知问题吗?有没有解决方案?
请检查更多细节:
离子信息:
通过修改我的<解决通过添加 - max_old_space_size ,在C:\ Users \ AppData \Roaming\ npm中生成strong> ionic.cmd 文件。我将我设置为 8096 。
@if EXIST%~dp0\\\
ode.exe(%~dp0\\\
ode.exe--max_old_space_size = 8096%~dp0 \ node_modules \ ion\bin\ionic%*)ELSE(@ SETLOCAL @ set PATHEXT =%PATHEXT:;。JS; =;%node --max_old_space_size = 8096%~dp0 \ node_modules \ ion\bin\ionic%*)
祝你好运!
检查实际来源:< a href =https://github.com/ionic-team/ionic-cli/issues/1453\"rel =noreferrer> https://github.com/ionic-team/ionic-cli/issues/1453
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
Error when running command: ionic cordova build android --prod
Note: that ionic build android, ionic run android and ionic serve all works fine.
I've read many topics that says once the project gets bigger, it stops working.
It was working the day before issue arrive. It stopped working as we added more files and JSON for translation of app in multi-language.
Is it a known issue? Is there any solution?
PLEASE CHECK FOR MORE DETAIL : https://youtu.be/oCN7iSt8rzg
Attached Error Image:
Ionic Info:
Resolved by modifying my ionic.cmd file in C:\Users\AppData\Roaming\npm by adding --max_old_space_size. I set mine to 8096.
@if EXIST "%~dp0\node.exe" (
"%~dp0\node.exe" --max_old_space_size=8096 "%~dp0\node_modules\ionic\bin\ionic" %*
) ELSE (
@SETLOCAL
@set PATHEXT=%PATHEXT:;.JS;=;%
node --max_old_space_size=8096 "%~dp0\node_modules\ionic\bin\ionic" %*
)
Good luck! Check Actual Source: https://github.com/ionic-team/ionic-cli/issues/1453
这篇关于离子cordova构建android --prod时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!