Wednesday, November 25, 2020

How to update your Angular app to version 11

Hello developers, as you all know that Angular has released version 11 recently with lot more feature like Updated Hot Module Replacement (HMR) Support for faster build or Updated Language Service Preview which is now on Ivy-based language service which provides a more powerful and accurate experience for developers. So this is the right time to update your existing Angular app to version 11 for more faster development and improved performance.

If you are struggling to updating your Angular app then post is going to help you. So to update your app to version 11 Angular has already provided an website (update.angular.io) which helps you step-by-step to accomplish your task successfully. Have a look on the image below:

updating angular app to version 11

If above site doesn't help or more complicate to you then this second and more faster and easiest option to update is run below command from your CLI:

ng update @angular/cli @angular/core

I know it is not that easy as it sounds you might get some issue during this process because sometime this update complains or warns you about various dependencies which needs to be updated which also depend on your existing Angular version. If still you couldn't success to update then I would recomend you do it manually by following below steps:

STEP 1: Run this below command from your CLI and make sure you are not running this command at your Angular project level because it should show your global versions not your local versions:

ng update

Result of above command will be showing what to update something like below. See image below for reference:

ng update

STEP 2: Remove older verion of your Angular (@angular/cli) globally by running following command from your CLI:

npm uninstall -g @angular/cli

After this run ng --version to confirm that Angular has uninstalled.

STEP 3: Now run following command from your CLI to install latest version of Angular globally which version 11:

npm install -g @angular/cli

Once installation is complete then run ng --version to confirm that Angular 11 has installed successfully.

I hope would have updated to Angular 11 successfully. Let me know if you still find any difficult by commenting below. I would love to help you. Also if you think this post has helped then let me know your opinion and don't forget to share this post with other developers.

Have a nice day! See you in the next blog post.

No comments:

Post a Comment