4

The ng upgrade command for updating cli version from a v7 project to v8 fails.

Manually trying to upgrade cli first also fails.

ng update @angular/cli

Your global Angular CLI version (8.0.1) is greater than your local version (7.3.9). The local Angular CLI version is used.

Package "@angular/compiler-cli" has an incompatible peer dependency to "typescript" (requires ">=3.1.1 <3.3", would install "3.4.5"). Incompatible peer dependencies found. See above.

Sunil Kashyap
  • 2,903
  • 2
  • 14
  • 30
avinashkr
  • 494
  • 4
  • 18

2 Answers2

19

try upgrading all packages using ng update --all --force if this doesn't work then try upgrading core and CLI ng update @angular/core @angular/cli.

and still not working then install typescript manually using npm i typescript@3.4

Sunil Kashyap
  • 2,903
  • 2
  • 14
  • 30
  • Your solution is should solve the OP's issues, though I would disagree on installing the latest version of typescript, as the Angular CLI/transpiler/compiler only supports up to a specific TypeScript version – wentjun Jun 06 '19 at 08:01
  • totally agree with you @wentjun, updated the answer and thanks for pointing out. – Sunil Kashyap Jun 06 '19 at 08:18
1

Like answer above, force the update, but in my case typescript@latest doesn't work because angular requires typescipt@3.4. If you force all it install 3.5 version and you must downgraded it

Nicola
  • 82
  • 1
  • 10