angularngrx

error occurs while trying to update ngrx store


While running ng update @ngrx/store I got the following error:

Package "@ngrx/store" has an incompatible peer dependency to "@angular/core" (requires "^10.0.0", would install "11.0.5") × Migration failed: Incompatible peer dependencies found. Peer dependency warnings when installing dependencies means that those dependencies might not work correctly together. You can use the '--force' option to ignore incompatible peer dependencies and instead address these warnings later.

I do not understand the error, since my ng version is already 11.0.5...

Is anyone able to help?

I just successfully updated angular via ng update, but then encountered the error trying to update @ngrx/store

My package.json file (minus irrelevant parts):

{
  "dependencies": {
    "@angular/animations": "~11.0.5",
    "@angular/cdk": "^11.0.3",
    "@angular/common": "~11.0.5",
    "@angular/compiler": "~11.0.5",
    "@angular/core": "~11.0.5",
    "@angular/forms": "~11.0.5",
    "@angular/platform-browser": "~11.0.5",
    "@angular/platform-browser-dynamic": "~11.0.5",
    "@angular/router": "~11.0.5",
    "@fullcalendar/core": "^5.4.0",
    "@ngrx/store": "^10.0.1",
    "@ngrx/store-devtools": "^10.0.1",
    "rxjs": "~6.6.0",
    "tslib": "^2.0.0",
    "zone.js": "~0.10.2"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~0.1100.5",
    "@angular/cli": "~11.0.5",
    "@angular/compiler-cli": "~11.0.5",
    "@types/jasmine": "~3.6.0",
    "@types/jasminewd2": "~2.0.3",
    "@types/node": "^12.11.1",
    "codelyzer": "^6.0.0",
    "jasmine-core": "~3.6.0",
    "jasmine-spec-reporter": "~5.0.0",
    "karma": "~5.1.1",
    "karma-chrome-launcher": "~3.1.0",
    "karma-coverage-istanbul-reporter": "~3.0.2",
    "karma-jasmine": "~4.0.0",
    "karma-jasmine-html-reporter": "^1.5.0",
    "karma-junit-reporter": "^2.0.1",
    "protractor": "~7.0.0",
    "ts-node": "~8.3.0",
    "tslint": "~6.1.0",
    "typescript": "~4.0.5"
  }
}

Solution

  • Okay, so it looks like it is a bug. Thanks @RandyCasburn for pointing me towards it. My workaround for now was to remove @ngrx/store and @ngrx/store-devtools from my package.json, then re add them by running ng add @ngrx/store@latest and ng add @ngrx/store-devtool@latest