Angular Framework Migration – Guidelines

In this article, I shall highlight the basic steps required to migrate the old Angular application to the recently released Angular applications.

Today in this article, we will cover below aspects,

Today here we will see how to migrate the Angular framework with real examples.

If you need to perform any old framework migration like Angular 6 or 7 then you must migrate the application to Angular 8 first and use below steps explained to complete the migration Angular to latest version.

Steps to perform a migration of the old Angular app

Before migration, please make sure to install Node version 10.13 or later.

Below are a few generic steps to be followed to migrate any old Angular framework application to the latest framework,

  • Make sure to install the global version of Angular CLI. Please use the command with ‘-g’.

npm install -g @angular/cli@latest

  • Update the Angular CLI for a local workspace (Local). Run the below command within your project workspace directory.

npm install --save -dev @angular/cli@latest

Or

The above command is obsolete from Angular 9 and onwards. Please use the below commands for angular 9 and 10 onwards,

npm install --save --only=dev @angular/cli@latest

  • Run the Update command to get a list of all dependencies required to be upgraded.

ng update

The above commands shall highlight all the required core angular components that require migration.

Angular 910 Framework Migration Guidelines

  • Next Please run the update command as below for each individual Angular core package, again you need to run the command in the project workspace directory.

ng update @angular/cli @angular/core

Or try the below command for any error,

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

Angular 910 Framework Migration Guidelines

  • Next, Build the app using ng build

Angular 910 Framework Migration Guidelines

Finally, the build runs successfully.

Cheers!

Other useful references,

Happy coding !!

Did the above steps resolve your issue? Please sound off in the comments below!



Please bookmark this page and share it with your friends. Please Subscribe to the blog to receive notifications on freshly published(2024) best practices and guidelines for software design and development.



Leave a Reply

Your email address will not be published. Required fields are marked *