Cannot update a project from Angular 13 to 14

Viewed 4596

I have a project which uses Angular 13 and I want to update it to Angular 14.

When I try to update with:

ng update @angular/core@14 @angular/cli@14

I get:

Package "@angular-eslint/schematics" has an incompatible peer dependency to "@angular/cli" (requires ">= 13.0.0 < 14.0.0", would install "14.0.1").

Any ideas on how to avoid this error?

3 Answers

I have two suggestions:


Suggestion 1:

  1. First upgrade the @angular-eslint/schematics package
ng update @angular-eslint/schematics@14
  1. Upgrade Angular
ng update @angular/core@14 @angular/cli@14

Suggestion 2:

  1. Remove all @angular-eslint packages from package.json file and run npm install so the packages would be deleted
npm install
  1. Upgrade Angular
ng update @angular/core@14 @angular/cli@14
  1. Add all @angular-eslint packages with ng add @angular-eslint/schematics command:
ng add @angular-eslint/schematics

Take a look at this draft PR's description instructions which will allow you to use an alpha version of the @angular-eslint/schematics package which will therefore allow you to upgrade but personally i would wait until this is merged and stabled before upgrading.

https://github.com/angular-eslint/angular-eslint/pull/1004

Use ng update @angular/core@14 @angular/cli@14 --force

After the update, remove node_modules and package.lock. Run npm install

Related