Angular2 aot build error - JavaScript heap out of memory

My angular 2 application was created using angular2 -webpack-starter. When I run the command "npm run build: aot" to build the aot package. The following error message appears on the console:


..... 92% asset optimization <--- The last few GCs --->

500690 ms: Mark-sweep 1290.1 ​​(1421.8) → 1290.1 ​​(1437.8) MB, 1219.8 / 0.0 ms [distribution failure] [GC in the requested old space]. 501898 ms: Mark-sweep 1290.1 ​​(1437.8) → 1290.1 ​​(1437.8) MB, 1207.9 / 0.0 ms [distribution failure] [GC in the requested old space]. 503171 ms: Mark scan 1290.1 ​​(1437.8) → 1298.4 (1421.8) MB, 1272.9 / 0.0 ms [last gc option]. 504540 ms: Mark-sweep 1298.4 (1421.8) → 1306.8 (1421.8) MB, 1368.3 / 0.0 ms [latest gc version].

<--- JS stacktrace --->

==== JS stack trace ======================================= =

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 Selection failed - JavaScript heap from memory ......


I added a message to add the option -max-old-space-size = 8192 for node.js But it seems that there is no effect.

+5
source share

Source: https://habr.com/ru/post/1268422/


All Articles