3

I am trying to update my exisiting angular 9 project to Angular 10, using the steps given in the official docs. ng update @angular/cli worked fine.

But,I am getting an error in the next step. ng update @angular/core

Error - Package "@angular-devkit/build-angular" has an incompatible peer dependency to "typescript" (requires ">=3.6 < 3.9", would install "3.9.7")

Below, is my current package.json.

  "dependencies": {
    "@angular/animations": "~10.0.8",
    "@angular/cdk": "^9.2.4",
    "@angular/common": "~10.0.8",
    "@angular/compiler": "~10.0.8",
    "@angular/core": "~10.0.8",
    "@angular/fire": "^6.0.2",
    "@angular/flex-layout": "^9.0.0-beta.31",
    "@angular/forms": "~10.0.8",
    "@angular/localize": "^10.0.8",
    "@angular/material": "^9.2.4",
    "@angular/platform-browser": "~10.0.8",
    "@angular/platform-browser-dynamic": "~10.0.8",
    "@angular/router": "~10.0.8",
    "@ngrx/store": "^9.2.0",
    "firebase": "^7.16.0",
    "hammerjs": "^2.0.8",
    "mat-video": "^2.8.1",
    "rxjs": "~6.5.4",
    "tslib": "^1.10.0",
    "zone.js": "~0.10.2"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~0.1000.5",
    "@angular/cli": "~10.0.5",
    "@angular/compiler-cli": "~10.0.8",
    "@types/node": "^12.11.1",
    "@types/jasmine": "~3.5.0",
    "@types/jasminewd2": "~2.0.3",
    "codelyzer": "^5.1.2",
    "jasmine-core": "~3.5.0",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~5.0.0",
    "karma-chrome-launcher": "~3.1.0",
    "karma-coverage-istanbul-reporter": "~2.1.0",
    "karma-jasmine": "~3.0.1",
    "karma-jasmine-html-reporter": "^1.4.2",
    "protractor": "~7.0.0",
    "ts-node": "~8.3.0",
    "tslint": "~6.1.0",
    "typescript": "~3.9.7",
    "@angular-devkit/architect": ">= 0.900 < 0.1100",
    "firebase-tools": "^8.0.0",
    "fuzzy": "^0.1.3",
    "inquirer": "^6.2.2",
    "inquirer-autocomplete-prompt": "^1.0.1",
    "open": "^7.0.3"
  }
}

Can anyone help me in solving this error?

Cedric Ipkiss
  • 5,662
  • 2
  • 43
  • 72
Daisy
  • 73
  • 1
  • 10

3 Answers3

1

I have fixed by reinstalling @angular-devkit/build-angular, like this:

npm install --save-dev install @angular-devkit/build-angular

Try it, it works for me.

dev.doc
  • 569
  • 3
  • 12
  • 18
Ajbeem
  • 11
  • 1
0

Very late answer, but could be helpful to someone: In package.json, change typescript to 3.9.7 and then run npm update. After that, upgrade Angular once more. Should work

Cedric Ipkiss
  • 5,662
  • 2
  • 43
  • 72
-1

Which parts of that error message are unclear to you? As far as I see, you've required "typescript": "~3.9.7", but the upgrading process tells you that @angular-devkit/build-angular is not compatible with that package. Probably, you should downgrade the typescript package

Nico Haase
  • 11,420
  • 35
  • 43
  • 69
  • Typescipt package version was upgraded as a part of `ng update @angular/cli`. \n Message while updating @angular/cli, `Updating package.json with dependency typescript @ "3.9.7" (was "3.8.3")...` – Daisy Aug 07 '20 at 09:41
  • Is there any reason that you require it on your own? – Nico Haase Aug 07 '20 at 09:42
  • packages `@angular-devkit/build-angular` and `typescript` both were installed during the angular project creation and would have assumed the update process to take care of it instead of manually updating typescript. – Amrish Aug 23 '20 at 05:19