Updating Angular and CLI causes: Incompatible peer dependencies found

Viewed 6225

When I try to update angular using ng update @angular/cli @angular/core, I get the following error:

Package "codelyzer" has an incompatible peer dependency to "@angular/compiler" (requires ">=2.3.1 <8.0.0 || 7.0.0-beta <8.0.0" (extended), would install "10.1.6"). Package "@angular-devkit/build-angular" has a missing peer dependency of "@angular/localize" @ "^10.0.0". Package "@ng-bootstrap/ng-bootstrap" has an incompatible peer dependency to "@angular/common" (requires "^8.0.0" (extended), would install "10.1.6"). Package "codelyzer" has an incompatible peer dependency to "@angular/core" (requires ">=2.3.1 <8.0.0 || >7.0.0-beta <8.0.0" (extended), would install "10.1.6"). Package "@ng-bootstrap/ng-bootstrap" has an incompatible peer dependency to "@angular/forms" (requires "^8.0.0" (extended), would install "10.1.6"). Package "tsickle" has an incompatible peer dependency to "typescript" (requires "~3.3.1", would install "4.0.3"). Package "@angular/http" has an incompatible peer dependency to "@angular/platform-browser" (requires "7.2.16" (extended), would install "10.1.6"). Incompatible peer dependencies found. See above.

What is the meaning of incompatible peer dependency?

How to fix each one of these requirements?

2 Answers

try ng update codelyzer first, then ng update @angular/core @angular/cli, and ng update @angular/material if it's need

If you encounter Package "codelyzer" has an incompatible peer dependency to "@angular/compiler" please run ng update codelyzer@latest. This will update it in the package.json.

Thereafter you can run ng update @angular/core @angular/cli ( For updating to Anguar 11 ) again. In my case this worked well.

Related