To uninstall or upgrade the Angular CLI (Command Line Interface), you can use npm OR yarn, the package manager. Here’s how you can do it:

Uninstall Angular CLI:

-> To uninstall the Angular CLI globally, you can use the following npm command:
npm uninstall -g @angular/cli
npm cache clean --force

This command removes the Angular CLI package from your global npm installation and npm cache clean with clear the npm cache from the local.

You can verify the uninstallation by running the below commands.
If npm > 5 you may need to use cache verify instead. Npm cache verify
Run, ng –version-> will return an error message if uninstall succeed

-> To uninstall the Angular CLI globally, you can use the following yarn command:
Check Global Installation: yarn global list
Look for @angular/cli in the list of globally installed packages.
If @angular exists uninstall angular cli using yarn global remove @angular/cli

After Uninstallation verify using the command yarn global list

Upgrade Angular CLI:

To upgrade the Angular CLI to the latest version, you can use npm as well. First, uninstall the current version globally using the command mentioned above. Then, install the latest version:
-> Using npm
npm install -g @angular/cli
Install Specific version of CLI using the command pattern below.

npm install -g @angular/cli@

-> Using yarn
yarn global add @angular/cli
Install Specific version of CLI using the command pattern below.
yarn global add @angular/cli@

This command installs the latest Or specific version of the Angular CLI globally on your system.

Check Angular CLI Version:

After installing or upgrading, you can verify the installed version of the Angular CLI using the following command:
ng --version
This command will display the version of Angular CLI installed globally on your system

Support On Demand!

Angular