在使用 ng build --prod 命令时,我遇到了以下问题:
致命错误:CALL_AND_RETRY_LAST 分配失败 - JavaScript 堆内存已满
我尝试通过使用 https://github.com/endel/increase-memory-limit 来增加大小限制,但它仍无法构建。我需要在 node_modules 中更改任何地方吗?
正在构建模块的 10%,共 6/8 个模块,其中 2 个处于活动状态 ...\bootstrap\dist\css\bootstrap 90% chunk assets processing<--- 最后几次 GC --->
174152 毫秒:Mark-sweep 1266.2 (1435.6) -> 1265.2 (1435.6) MB,934.7 / 0.0 毫秒 [分配失败] [请求老年代的 GC]。
175021 毫秒:Mark-sweep 1265.2 (1435.6) -> 1265.2 (1435.6) MB,869.8 / 0.0 毫秒 [分配失败] [请求老年代的 GC]。
175964 毫秒: Mark-sweep 1265.2 (1435.6) -> 1267.9 (1410.6) MB,942.4 / 0.0 毫秒 [最后的 回收]。
176889 毫秒:Mark-sweep 1267.9 (1410.6) -> 1271.4 (1410.6) MB,924.1 / 0.0 毫秒 [最后的回收]。
<--- JS 堆栈跟踪 --->
==== JS 堆栈跟踪 =========================================
安全上下文:0000011C7D03FA99 1: getLast(也称为 getLast) [E:\projects\Nila Company\memarane\front-end\node_modules\escope\lib\pattern-visitor.js:~45] [pc=000002C336273AA1] (this=0000011C7D004241 ,xs=0000037217E78589 ,xs=0000037217E78589 ) 2: Identifier [E:\projects\Nila Company\memarane\front-end\node_modules\escope\lib\pattern-visitor.js:76] [pc=000002C335B8874A] (this=0000037217E78539
致命错误:CALL_AND_RETRY_LAST 分配失败 - JavaScript 堆内存已满
我的依赖关系如下:
"dependencies": {
"@angular/animations": "^4.0.0",
"@angular/common": "^4.0.0",
"@angular/compiler": "^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.0.0",
"@mm2/bsmodal": "^1.0.1",
"@ng-bootstrap/ng-bootstrap": "1.0.0-beta.5",
"@ngu/carousel": "^1.4.2",
"angular-froala-wysiwyg": "^1.0.0",
"angular-popper": "^1.0.0-beta-1",
"angular2-jwt": "^0.2.3",
"animate.css": "^3.5.2",
"aos": "^2.2.0",
"bootstrap": "4.0.0-beta.2",
"core-js": "^2.4.1",
"font-awesome": "^4.7.0",
"hammerjs": "^2.0.8",
"jalali-moment": "^2.1.8",
"jquery": "^3.2.1",
"ng2-completer": "^1.6.1",
"ng2-datepicker-jalali": "^1.0.9",
"ng2-scroll-to-el": "^1.0.0",
"ngx-carousel": "^1.3.1",
"ngx-cookie-service": "^1.0.9",
"ngx-progressbar": "^2.1.1",
"ngx-quill": "^1.6.0",
"ngx-quill-editor": "^2.2.2",
"popper.js": "^1.12.9",
"rxjs": "^5.4.1",
"wowjs": "^1.1.3",
"zone.js": "^0.8.14"
},
"devDependencies": {
"@angular/cli": "^1.6.1",
"@angular/compiler-cli": "^4.0.0",
"@angular/language-service": "^4.0.0",
"@types/jasmine": "~2.5.53",
"@types/jasminewd2": "~2.0.2",
"@types/jquery": "^3.2.16",
"@types/node": "~6.0.60",
"codelyzer": "~3.0.1",
"jasmine-core": "~2.6.2",
"jasmine-spec-reporter": "~4.1.0",
"karma": "~1.7.0",
"karma-chrome-launcher": "~2.1.1",
"karma-cli": "~1.0.1",
"karma-coverage-istanbul-reporter": "^1.2.1",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.1.2",
"ts-node": "~3.0.4",
"tslint": "~5.3.2",
"typescript": "~2.3.3"
}