Angular 角度10错误-错误TS2314:通用类型'ɵɵ;FactoryDef&x27;需要1个类型参数

Angular 角度10错误-错误TS2314:通用类型'ɵɵ;FactoryDef&x27;需要1个类型参数,angular,Angular,升级到angular 10.0后,我在ng serve上不断遇到以下错误: ../stocks/node_modules/@angular/core/core.d.ts:256:18中出错-错误TS2314:泛型类型“工厂定义”需要1个类型参数 256静态ɵfac:ɵngcc0.ɵɵFactoryDef; ../stocks/node_modules/@angular/core/core.d.ts:439:18-错误TS2314:泛型类型“工厂定义”需要1个类型参数。 439静态ɵfac:ɵng

升级到angular 10.0后,我在ng serve上不断遇到以下错误:

../stocks/node_modules/@angular/core/core.d.ts:256:18中出错-错误TS2314:泛型类型“工厂定义”需要1个类型参数

256静态ɵfac:ɵngcc0.ɵɵFactoryDef; ../stocks/node_modules/@angular/core/core.d.ts:439:18-错误TS2314:泛型类型“工厂定义”需要1个类型参数。 439静态ɵfac:ɵngcc0.ɵɵFactoryDef

../stocks/node_modules/@angular/core/core.d.ts:785:18-错误TS2314:泛型类型“工厂定义”需要1个类型参数。 785静态ɵfac:ɵngcc0.ɵɵFactoryDef

我已尝试删除“node_modules”文件夹npm cache clean--force并再次安装npm。我仍然得到这个错误

我在package.json中的依赖项如下:

“依赖项”:{ “@angular/animations”:“~10.0.0”, “@angular/common”:“~10.0.0”, “@angular/compiler”:“~10.0.0”, “@angular/core”:“~10.0.0”, “@angular/forms”:“~10.0.0”, “@angular/platform浏览器”:“~10.0.0”, “@angular/platform browser dynamic”:“~10.0.0”, “@angular/router”:“~10.0.0”, “rxjs”:“~6.5.5”, “tslib”:“^2.0.0”, “zone.js”:“~0.10.3” }, “依赖性”:{ “@angular devkit/build angular”:“~0.1000.0”, “@angular/cli”:“~10.0.0”, “@angular/compiler cli”:“~10.0.0”, “@types/node”:“^12.11.1”, “@types/jasmine”:“~3.5.0”, “@types/jasminewd2”:“~2.0.3”, “codelyzer”:“^6.0.0-next.1”, “茉莉花芯”:“~3.5.0”, “jasmine spec reporter”:“~5.0.0”, “因果报应”:“~5.0.0”, “卡玛铬发射器”:“~3.1.0”, “因果报应报道伊斯坦布尔记者”:“~3.0.2”, “噶玛茉莉”:“~3.3.0”, “karma jasmine html reporter”:“^1.5.0”, “量角器”:“~7.0.0”, “ts节点”:“~8.3.0”, “tslint”:“~6.1.0”, “类型脚本”:“~3.9.5” }


如何消除此错误?

也许您可以尝试此解决方案:删除节点模块和
npm cache verify
并重新安装。我也尝试过“npm cache verify”。再次出现相同的错误。也许您可以尝试此解决方案:删除节点_模块和
npm cache verify
并重新安装。我也尝试过“npm cache verify”。又是同样的错误。