Angular 8 - ng lint:超出最大调用堆栈大小错误

Posted

技术标签:

【中文标题】Angular 8 - ng lint:超出最大调用堆栈大小错误【英文标题】:Angular 8 - ng lint: Error in Maximum call stack size exceeded 【发布时间】:2020-08-22 14:01:17 【问题描述】:

我在整理我的项目时遇到了问题。 每次我使用“ng lint”时都会出现以下错误:

$ ng lint
Linting "app"...
An unhandled exception occurred: Maximum call stack size exceeded
See "C:\Users\6100BR~1\AppData\Local\Temp\ng-owDTzM\angular-errors.log" for further details.
error Command failed with exit code 127.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

但是,如果我尝试运行应用程序或尝试构建它,一切对我来说都很好。

版本:

"@angular-builders/custom-webpack": "^8.2.0", "@angular-devkit/build-angular": "^0.800.0", "@angular/cli": "^8.0.0", "@angular/compiler": "^8.0.0", "@angular/compiler-cli": "^8.0.0", "@angular/core": "^8.0.0", "@angular/flex-layout": "^8.0.0-beta", "@angular/language-service": "^8.0.0", "@fullcalendar/angular": "^4.3.1", "@fullcalendar/core": "^4.3.1", "@fullcalendar/daygrid": "^4.3.0", "@fullcalendar/list": "^4.3.0", "@fullcalendar/timegrid": "^4.3.0", “@types/jquery”:“^3.3.33”, “角度可调整大小的元素”:“^3.2.6”, “jquery”:“^3.4.1”, “rxjs”:“^6.5.0”, “萨斯”:“^1.23.0”, “打字稿”:“~3.4.0”, "webpack-bundle-analyzer": "^3.6.0", “zone.js”:“~0.9.0”

知道如何解决这个问题,或者有没有办法找到更容易理解的错误?

【问题讨论】:

【参考方案1】:

您可以像这样将脚本添加到package.json

"scripts": 
    "lint": "node --max_old_space_size=8192 --harmony node_modules/@angular/cli/bin/ng lint"

并执行:

npm run lint

【讨论】:

以上是关于Angular 8 - ng lint:超出最大调用堆栈大小错误的主要内容,如果未能解决你的问题,请参考以下文章

markdown Angular CLI:ng lint,ng test,ng e2e

Angular 6 ng lint combineLatest 已弃用

Angular 2 + CLI:超出最大调用堆栈大小错误

在文件保存时将 Angular 配置为“ng lint”

在 Angular 中添加 PWA 时超出最大调用堆栈大小

使用 Angular 7 和 `ng lint` 在 TypeScript 中自定义 TSLint 规则