3

Trying to use the schematics install for @ngrx/store but the installation keeps failing saying:

The package that you are trying to add does not support schematics. You can try using a different version of the package or contact the package author to add ng-add support.

Here are my angular dependency versions:

"dependencies": {
    "@angular/animations": "~9.0.1",
    "@angular/cdk": "^9.0.0",
    "@angular/common": "~9.0.1",
    "@angular/compiler": "~9.0.1",
    "@angular/core": "~9.0.1",
    "@angular/forms": "~9.0.1",
    "@angular/material": "^9.0.0",
    "@angular/platform-browser": "~9.0.1",
    "@angular/platform-browser-dynamic": "~9.0.1",
    "@angular/router": "~9.0.1",
    "apollo-angular": "^1.8.0",
    "apollo-angular-link-http": "^1.9.0",
    "apollo-cache-inmemory": "^1.6.0",
    "apollo-client": "^2.6.0",
    "apollo-link": "^1.2.11",
    "graphql": "^14.5.0",
    "graphql-tag": "^2.10.0",
    "rxjs": "~6.5.4",
    "tslib": "^1.10.0",
    "zone.js": "~0.10.2"
  },

This is a newly generated project and I have installed other packages using the ng add command to force the schematics install. Wondering if anyone can help figure out why ngrx/store is failing to install based on schematics. Here is the command I am running just to be clear: ng add @ngrx/store which throws above error.

This is the documentation I am using for this also: https://ngrx.io/guide/store/install#installing-with-ng-add

Thanks in advance.

Nicholas Pesa
  • 2,156
  • 2
  • 24
  • 45
  • 5
    Try running `ng add @ngrx/store@8.6.0` – R. Richards Feb 19 '20 at 01:35
  • Yep, that worked. Thank you @R.Richards – Nicholas Pesa Feb 19 '20 at 04:58
  • Any idea why it was adding the wrong version? When I looked at my package.json, it was adding version 1.2.1 of @ngrx/store to it.. – mjbates7 Mar 02 '20 at 17:27
  • For my example it wasn't really adding the wrong version, but `@ngrx/store@9.x` didn't have schematics implemented yet. So going back to v8.x.x works with schematics. Not sure why you would be getting a v1.x.x install. Can you share the command you are running? – Nicholas Pesa Mar 02 '20 at 17:31
  • All I did was run `ng add @ngrx/store` on an angular 9 project. Using 8.6.0 command above worked though – mjbates7 Mar 03 '20 at 15:06

0 Answers0