首页 > 解决方案 > 我最近在将 Angular 项目 9.0.7 更新到 9.1.9 时遇到错误

问题描述

最近,我遇到了一些错误。当我将我的 Angular 项目 9.0.7 更新到 9.1.9 时。这次我得到了这种类型的错误。


ERROR in ../AppState/node_modules/@angular/core/core.d.ts:256:18 - error TS2314: Generic type 'ɵɵFactoryDef' requires 1 type argument(s).

256     static ɵfac: ɵngcc0.ɵɵFactoryDef<ApplicationInitStatus, [{ optional: true; }]>;
                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../AppState/node_modules/@angular/core/core.d.ts:439:18 - error TS2314: Generic type 'ɵɵFactoryDef' requires 1 type argument(s).

439     static ɵfac: ɵngcc0.ɵɵFactoryDef<ApplicationRef, never>;
                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../AppState/node_modules/@angular/core/core.d.ts:785:18 - error TS2314: Generic type 'ɵɵFactoryDef' requires 1 type argument(s).

785     static ɵfac: ɵngcc0.ɵɵFactoryDef<Compiler, never>;
                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../AppState/node_modules/@angular/core/core.d.ts:5028:18 - error TS2314: Generic type 'ɵɵFactoryDef' requires 1 type argument(s).

5028     static ɵfac: ɵngcc0.ɵɵFactoryDef<PlatformRef, never>;
                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../AppState/node_modules/@angular/core/core.d.ts:6414:18 - error TS2314: Generic type 'ɵɵFactoryDef' requires 1 type argument(s).

6414     static ɵfac: ɵngcc0.ɵɵFactoryDef<SystemJsNgModuleLoader, [null, { optional: true; }]>;
                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../AppState/node_modules/@angular/core/core.d.ts:6611:18 - error TS2314: Generic type 'ɵɵFactoryDef' requires 1 type argument(s).

6611     static ɵfac: ɵngcc0.ɵɵFactoryDef<Testability, never>;
                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../AppState/node_modules/@angular/core/core.d.ts:6656:18 - error TS2314: Generic type 'ɵɵFactoryDef' requires 1 type argument(s).

6656     static ɵfac: ɵngcc0.ɵɵFactoryDef<TestabilityRegistry, never>;
                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../AppState/node_modules/@angular/core/core.d.ts:9555:18 - error TS2314: Generic type 'ɵɵFactoryDef' requires 1 type argument(s).

9555     static ɵfac: ɵngcc0.ɵɵFactoryDef<ɵConsole, never>;
                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../AppState/node_modules/@datorama/akita/lib/store.d.ts:138:18 - error TS2314: Generic type 'ɵɵFactoryDef' requires 1 type argument(s).

138     static ɵfac: ɵngcc0.ɵɵFactoryDef<Store<any>, never>;
                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

** Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **

我不明白是什么问题。请帮忙。

标签: node.jsangulartypescriptgenericsangular9

解决方案


删除并重新安装您的节点模块

更新你的角度 CLI

ng update @angular/cli @angular/core)

和你的打字稿

npm install -g typescript@latest

推荐阅读