我尝试将Angular CLI与@ngrx一起使用时出现错误

时间:2018-10-26 10:47:49

标签: angular angular-cli ngrx

我的Ng,Npm,NodeJs配置为:

Angular CLI: 7.0.2
Node: 10.12.0
OS: darwin x64
Angular: 7.0.0
... animations, cdk, common, compiler, compiler-cli, core, forms
... http, language-service, material, material-moment-adapter
... platform-browser, platform-browser-dynamic, router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.10.2
@angular-devkit/build-angular     0.10.2
@angular-devkit/build-optimizer   0.10.2
@angular-devkit/build-webpack     0.10.2
@angular-devkit/core              7.0.2
@angular-devkit/schematics        0.6.8
@angular/cli                      7.0.2
@ngtools/webpack                  7.0.2
@schematics/angular               7.0.2
@schematics/update                0.10.2
rxjs                              6.3.3
typescript                        3.1.3
webpack                           4.19.1

我要运行的是:

ng g store AppState --root --module app.module.ts

出现以下错误

Cannot read property 'entries' of undefined

更新

我可以创建一个商店,但不能创建一个动作:

➜  angular-ngrx-course git:(1-auth) ✗ ng g store AppStore --root --modiule app.module.ts
CREATE src/app/reducers/index.ts (359 bytes)
➜  angular-ngrx-course git:(1-auth) ✗ ng g action auth/Auth
Cannot read property 'entries' of undefined
➜  angular-ngrx-course git:(1-auth) ✗

1 个答案:

答案 0 :(得分:1)

已排序将 @ angular-devkit / schematics 的版本从 0.6.x 更改为 ^ 7.0.0