[英]Angular 2 : Error while save file when npm server is running
在npm期间运行保存.ts或.html时出现此错误
1: DoJoin(aka DoJoin) [native array.js:~129] [pc=0000035BB365DBB2]
(this=0000005A3F604381 <undefined>,w=000003CB8840CFF1 <JS
Array[104]>,x=104,N=0000005A3F6043C1
<true>,J=000000DB8B0DB361 <String[2]: , >,I=0000005A3F6B46F1 <JS Function
ConvertToString (SharedFunctionInfo 0000005A3F652DC9)>)
2: Join(aka Join) [native array.js:180] [pc=0000035BB3A1FB52]
(this=0000005A3F604381 <undefined...
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
如果angular-cli缺少堆,则可以通过在C:\\Users\\%userName%\\AppData\\Roaming\\npm
下更改ng.cmd
(或sh取决于所使用的操作系统)来增加它,如下所示:
@IF EXIST "%~dp0\node.exe" (
"%~dp0\node.exe" --max_old_space_size=8048 "%~dp0\node_modules\@angular\cli\bin\ng" %*
) ELSE (
@SETLOCAL
@SET PATHEXT=%PATHEXT:;.JS;=;%
node --max_old_space_size=8048 "%~dp0\node_modules\@angular\cli\bin\ng" %*
)
(路径可能因系统而异)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.