问题描述
我正在尝试导入 NGRX 以构建一个新的 Angular 应用程序,但是当我使用 ng serve 时,我的终端出现此错误:
I am trying to import NGRX to build a new Angular application but i have this error in my terminale when i use ng serve:
node_modules/@ngrx/store/src/reducer_creator.d.ts:32:99 中的错误 - 错误 TS1005: ',' 预期.
ERROR in node_modules/@ngrx/store/src/reducer_creator.d.ts:32:99 - error TS1005: ',' expected.
32 export 声明函数 on(...args: [...creators: Creators, reducer: OnReducer]): ReducerTypes;~node_modules/@ngrx/store/src/reducer_creator.d.ts:32:118 - 错误 TS1005: ',' 预期.
32 export declare function on<State, Creators extends readonly ActionCreator[]>(...args: [...creators: Creators, reducer: OnReducer<State, Creators>]): ReducerTypes<State, Creators>;~node_modules/@ngrx/store/src/reducer_creator.d.ts:32:118 - error TS1005: ',' expected.
32 export 声明函数 on(...args: [...creators: Creators, reducer: OnReducer]): ReducerTypes;
32 export declare function on<State, Creators extends readonly ActionCreator[]>(...args: [...creators: Creators, reducer: OnReducer<State, Creators>]): ReducerTypes<State, Creators>;
这是我的 Angular cli/节点版本/操作系统角 CLI:9.1.0节点:10.13.0操作系统:达尔文 x64
This Is my angular cli / node version / OSAngular CLI: 9.1.0Node: 10.13.0OS: darwin x64
推荐答案
NgRx v11 期望使用 TypeScript 4 和 Angular 11.https://ngrx.io/guide/migration/v11
NgRx v11 expects TypeScript 4 to be used and Angular 11. https://ngrx.io/guide/migration/v11
这篇关于Angular 应用程序中的 ngrx 导入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!