Angular 2 AOT build error - JavaScript heap out of memory

元气小坏坏 提交于 2020-01-03 18:59:28

问题


My Angular 2 app is generated by angular2-webpack-starter.

When I run command npm run build:aot to build AOT package, the console shows the following error message:

..... 92% chunk asset optimization

500690 ms: Mark-sweep 1290.1 (1421.8) -> 1290.1 (1437.8) MB, 1219.8 / 0.0 ms [allocation failure] [GC in old space requested]. 501898 ms: Mark-sweep 1290.1 (1437.8) -> 1290.1 (1437.8) MB, 1207.9 / 0.0 ms [allocation failure] [GC in old space requested]. 503171 ms: Mark-sweep 1290.1 (1437.8) -> 1298.4 (1421.8) MB, 1272.9 / 0.0 ms [last resort gc]. 504540 ms: Mark-sweep 1298.4 (1421.8) -> 1306.8 (1421.8) MB, 1368.3 / 0.0 ms [last resort gc].


Security context: 0000002FDCDCFB61 2: enter [D:\Code\BIMS\node_modules\optimize-js\lib\index.js:~13] [pc=0000033281F0E5C5] (this=0000008415DEBED9 ,node=000003AAAC2EFB31 2 4: visit(aka visit) [D:\Code\BIMS\node_modules\estree-walker\dist\estree-walker.umd....

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

I have followed this post to add --max-old-space-size=8192 option for Node.js, but it seems that there is no effect.

来源:https://stackoverflow.com/questions/44299738/angular-2-aot-build-error-javascript-heap-out-of-memory

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!