I just tried to add NgRx to my project reading this https://ngrx.io/guide/schematics/store and I get error when run the command ng generate store State --root --module app.module.ts:
An unhandled exception occurred: Schematic "store" not found in collection "@schematics/angular".
I did install it with npm install @ngrx/schematics --save-dev.
What am I doing wrong?
Windows 10 x64, node 10.16.0, angular 8.1.0
Log:
[error] Error: Schematic "store" not found in collection "@schematics/angular".
at SchematicEngine.createSchematic ([path]\node_modules\@angular-devkit\schematics\src\engine\engine.js:232:23)
at CollectionImpl.createSchematic ([path]\node_modules\@angular-devkit\schematics\src\engine\engine.js:69:29)
at GenerateCommand.getSchematic ([path]\node_modules\@angular\cli\models\schematic-command.js:136:27)
at GenerateCommand.initialize ([path]\node_modules\@angular\cli\models\schematic-command.js:46:36)
at process._tickCallback (internal/process/next_tick.js:68:7)
at Function.Module.runMain (internal/modules/cjs/loader.js:832:11)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
uninstalled it with npm. And then installed it with ng add @ngrx/schematics. Now it works!
ng add sets the default collection, if you install it via npm or yarn, you need to do this manually.
Most helpful comment
uninstalled it with
npm. And then installed it withng add @ngrx/schematics. Now it works!