Angular 应用程序中的 ngrx 导入 [英] ngrx import in angular application

查看:88
本文介绍了Angular 应用程序中的 ngrx 导入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试导入 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 / OS Angular CLI: 9.1.0 Node: 10.13.0 OS: 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 导入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆