运行 nggenerate @ngrx/schematics:store AppState --root --module app.module.ts 时出现“ts.getDecorators 不是函数”错误

问题描述 投票:0回答:2

enter image description here 这是我运行命令时的错误

我期待解决这个问题

ngrx
2个回答
0
投票

可能

@ngrx/schematics
的版本与
@ngrx/store
的版本不同,你可以在你的项目的
package.json
文件中查看。

如果不同,- 手动将

@ngrx/store
版本复制到
@ngrx/schematics
版本并运行
npm install

顺便说一句,检查文件 angular.json 中是否存在此行:

"cli": {
  "schematicCollections": [
    "@ngrx/schematics"
  ]
}

0
投票

当我更改 ngrx 版本与 package.json 中的 Angular 版本相同时,这个问题解决了我,然后 npm i

© www.soinside.com 2019 - 2024. All rights reserved.