2017-07-26 21 views
0

我正在使用角度cli。請檢查我的CLI信息角度2中的JavaScript堆內存不足

@angular/cli: 1.2.1 
node: 6.10.0 
os: win32 x64 
@angular/animations: 4.1.1 
@angular/common: 4.0.0 
@angular/compiler: 4.0.0 
@angular/compiler-cli: 4.0.0 
@angular/core: 4.0.0 
@angular/forms: 4.0.0 
@angular/http: 4.0.0 
@angular/platform-browser: 4.0.0 
@angular/platform-browser-dynamic: 4.0.0 
@angular/router: 4.1.1 

當我使用ng serve --aot以下error.Please幫助亞姆gtteing!

< ---過去數個地方選區--->

893427毫秒: - 在舊空間> 1339.9(1434.3)MB,925.7/0.0毫秒[分配失敗] [GC標記 - 清除1344.1(1434.3)請求。 894468 ms:標記掃描1339.9(1434.3) - > 1339.9(1434.3)MB,1040.5/0.0 ms [分配失敗] [請求的舊空間中的GC]。 895402 ms:標記掃描1339.9(1434.3) - > 1339.6(1418.3)MB,933.7/0.0ms [最後手段gc]。 896331 ms:標記掃描1339.6(1418.3) - > 1339.8(1418.3)MB,928.1/0.0ms [最後手段gc]。

< --- JS堆棧跟蹤--->

==== JS堆棧跟蹤========================= ================

安全上下文:000001AF8A2CFB61 2:/ * anonymous */[C:\ project_folder \ node_modules \ source-map \ lib \ source-node。 JS:100] [PC = 0000016E99866533](這= 00000346870554E1,映射= 000003C18FDC93C9) 3:參數適配器框架:3-> 1 4:InnerArrayForEach(又名InnerArrayForEach)[天然array.j ...

致命錯誤: CALL_AND_RETRY_LAST分配失敗 - 的JavaScript堆出來的內存

+1

我想設置'--max_old_space_size'應該幫助你也看到這個線程https://github.com/angular/angular-cli/issues/5618 – yurzui

+0

另外:https://stackoverflow.com/questions/41955769/angular-2-aot-error-fatal-error-call-and-retry-last-allocation-failed-javasc,https://stackoverflow.com/questions/41517738/angular-cli-javascript-heap-out-of-memory-on-asset- – echonax

+0

我嘗試了所有的方法。但仍然收到相同的錯誤。請幫忙!!! – user3541485

回答

0

嘗試修改文件,並替換爲以下的內容:(文件夾中:node_modules \ BIN)

修改ng.cmd:

@IF EXIST "%~dp0\node.exe" (
    "%~dp0\node.exe" --max_old_space_size=5048 "%~dp0\..\angular-cli\bin\ng" %* 
) ELSE (
    @SETLOCAL 
    @SET PATHEXT=%PATHEXT:;.JS;=;% 
    node --max_old_space_size=5048 "%~dp0\..\angular-cli\bin\ng" %* 
) 

修改ngc.cmd:

@IF EXIST "%~dp0\node.exe" (
    "%~dp0\node.exe" --max_old_space_size=5048 "%~dp0\..\@angular\compiler-cli\src\main.js" %* 
) ELSE (
    @SETLOCAL 
    @SET PATHEXT=%PATHEXT:;.JS;=;% 
    node --max_old_space_size=5048 "%~dp0\..\@angular\compiler-cli\src\main.js" %* 
) 
+0

我仍然有同樣的錯誤 – user3541485

0

我有同樣的問題 在我tsconfig.json我有

"include": [ "**/*" ],

刪除此包括後,黃氏建立正常的行爲再次