Angular 13 version released How to upgrade from 12 to 13?

Angular 13 version was released on November 04, 2021, from Google.

In this tutorial, LearnLatest Angular 13 features, Learn how to upgrade Angular 12 to 13

What are the features of Angular 13?

The following features add to the Angular 13 version.

  • Improving cache support in Angular CLI
  • The view engine is completely removed and added support for the IVY engine
  • Angular test API Improvements
  • IE11 Support Removed completely
  • There is no support for TypeScript version below 4.4.2, Typescript version 4.4 is supported in Angular 13 version
  • The nodejs version below v12.12.0 is not supported
  • RXjs7.4 is a default version when you create an application with CLI ng new command.
  • Adobe fonts are supported by default to improve FCP
  • Angular Package Format (APF) modification

How to upgrade an existing application to Angular 15

In this tutorial, Let’s see the steps for upgrading an application from Angular version 12 to 13.

First, Uninstall Angular CLI either globally or locally.

 npm uninstall  @angular/cli

 or

 npm uninstall  -g @angular/cli

It uninstalls the current angular CLI in your application or system.

If it is a new application, We can use ng new application Following is a command to install the Angular CLI 13 version manually

 npm install @angular/core@13 @angular/cli@13

If it is an existing angular 12 application, We can use the below command

ng update @angular/cli @angular/core

For material/cdk upgrade

ng update @angular/cdk

if you are using angular material

ng update @angular/material

If you got any errors you can append —allow-dirty and —force option

ng update @angular/cli @angular/core --allow-dirty --force
ng update @angular/material --allow-dirty --force
ng update @angular/cdk --allow-dirty --force

If your project is any outdated dependencies, you can find out using the below command.

npm outdated

It lists out all direct dependencies with the current and latest version and does not update to package.json

If you want to upgrade all dependencies to the latest version, run the below command

ncu -u

It updates to the latest version in package.json.

Next, run npm install command to install dependencies.