在集合“@schematics/angular”中找不到原理图“store”

2024-04-26

我使用以下命令安装 ngrx/store :

ng add @ngrx/store 

然后我想添加商店

ng generate store auth/Auth --module auth.module.ts

出现以下错误:

发生未处理的异常:在以下位置找不到原理图“存储” 集合“@schematics/Angular”。请参阅“xxx\angular-errors.log”了解 更多细节。


Because ngrx不是直接的角度示意图。 Ngrx 是一个外部库,它提供向 Angular 项目添加文件或创建文件的支持

您应该从 ngrx 原理图 json 文件生成存储文件,为此您应该运行如下命令

ng generate @ngrx/schematics:store State --root --module app.module.ts

如果上述命令失败则需要运行此命令

npm i @ngrx/schematics -D

您可以在这里找到其使用的详细文档:@ngrx/原理图 https://ngrx.io/guide/schematics

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

在集合“@schematics/angular”中找不到原理图“store” 的相关文章

随机推荐