How to update/uninstall Angular CLI

How to upgrade Angular CLI in a proper way? to understand this see how this really works from the NPM registry side.

How to update/uninstall Angular CLI
How to update/uninstall Angular CLI - mobilelabs.in

What you will learn

  1. How to upgrade/update Angular CLI
  2. How to uninstall Angular CLI
  3. How to clean npm cache
  4. How to install specific version of @angualr/cli

How to upgrade/update Angular CLI

How to upgrade Angular CLI in a proper way? to understand this see how this really works from the NPM registry side.

We need to make sure which is recently released in the registry, this can be done by going here angular release or we can also get the list of the version available by using npm view command.

npm view @angular/cli versions
How to upgrade/update Angular CLI - mobilelabs.in

The above output is the list of published versions of @angualr/cli this include the pre-release version as well.

How we can make sure which one of this currently installed in system? let's use npm view command.

npm show @angular/cli version
View npm module installed version - mobilelabs.in

First we have to remove our existing @angualr/cli by using npm uninstall command.

npm uninstall -g @angular/cli
npm cache clean --force

This will move the @angualr/cli from the system.

Run install command again for installing latest version

npm install -g @angular/cli

Now run the npm show command to see version of the Angular CLI again.

npm show @angular/cli version

This should output the latest version on your screen.

How to install specific version of @angualr/cli

We may need to do sometime when we work on the long term projects, this can be done at just by running install command with the version

npm install -g @angular/[email protected]

Conclusion

We have seen how to install/upgrade the Angular CLI and how to use npm basic routines also we see how to install specific version of Angular CLI.

Subscribe and Share if you like.

Leave your feedback on comments below.