我正在使用 Angular CLI。请检查我的 CLI 信息
@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
我收到以下错误。
最后几次 GC
893427 ms:标记-扫描 1344.1 (1434.3) -> 1339.9 (1434.3) MB,925.7 /
0.0 ms [分配失败] [请求旧空间中的 GC]。 894468 毫秒:标记-扫描 1339.9 (1434.3) -> 1339.9 (1434.3) MB,1040.5 / 0.0 毫秒
[分配失败] [请求旧空间中的 GC]。 895402 毫秒:
标记-清除 1339.9 (1434.3) -> 1339.6 (1418.3) MB, 933.7 / 0.0 ms [最后
度假村GC]。 896331 毫秒:标记-清除 1339.6 (1418.3) -> 1339.8 (1418.3)
MB,928.1 / 0.0 毫秒 [GC 的最后手段]。
JS 堆栈跟踪
安全上下文:000001AF8A2CFB61
2: /* 匿名 */ [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 堆
内存不足
尝试修改文件并将其内容替换为以下内容:(在文件夹中: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" %*
)
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)