How to upgrade Angular CLI older versions to Angular CLI 8

Angular 8 is the latest version of Angular. Here, we are specifying how to upgrade your older version of Angular in the latest one. It doesn’t matter which Angular’s version you are using, you can easily update it to Angular 8 by using the following steps:

Step 1: First, check your current version of Angular CLI by using the following command.

ng -version  
How to upgrade Angular CLI older versions to Angular CLI 8

You can see in the above output that we are using Angular 7. Now, we have to update it to Angular 8.

Step 2: Run the following command to uninstall your older version of Angular.

npm uninstall -g angular-cli // For Windows Open Powershell on Administrator Mode  

sudo npm uninstall -g angular-cli // For Mac 
    How to upgrade Angular CLI older versions to Angular CLI 8

    Step 3: Now you have to verify and clear the cache by using the following commands.

    npm cache verify  
    How to upgrade Angular CLI older versions to Angular CLI 8
    npm cache clean  
    How to upgrade Angular CLI older versions to Angular CLI 8

    Step 4:Now, install the latest Angular CLI (Angular 8) by using the following command.

    npm install -g @angular/cli@latest  
    How to upgrade Angular CLI older versions to Angular CLI 8

    Step 5: Angular 8 CLI is now installed in your system. You can check it by using the following command.

    ng --version   
    How to upgrade Angular CLI older versions to Angular CLI 8

    Now, you can see that Angular 8 is installed in your system.

    Note: After updating both global and local package, you should clear the cache to avoid errors.

    How to upgrade Angular CLI older versions to Angular CLI 8

    Update Angular Packages

    If you have already created your project in older Angular version then go inside that folder and use the following command to update that package.

    ng update @angular/core  

    Comments

    Leave a Reply

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