How to Uninstall and Install Angular CLI

Rana Hasnain Khan Feb 02, 2024
  1. Uninstall Angular CLI
  2. Install the Latest Version of Angular CLI
How to Uninstall and Install Angular CLI

We will introduce how we can easily uninstall Angular CLI using commands in Angular.

Uninstall Angular CLI

There are many reasons to uninstall Angular CLI. We may want to update the CLI to the latest version, so we may have to uninstall it completely from our computer.

We may want to make a fresh installation, and for that, we first need to uninstall the Angular CLI and remove all its instances from our computer. We need to follow a few steps to uninstall the angular CLI completely from our computer.

First of all, we will use the uninstall command below.

# angular
npm uninstall -g @angular/cli

Now using the command below, we will clean our cache.

# angular
npm cache clean

Next, we must delete the @angular folder from the following directory.

C:\Users\YOU\AppData\Roaming\npm\node_modules\@angular` folder.

Finally, we have completely uninstalled the Angular CLI.

Install the Latest Version of Angular CLI

Suppose we want to freshly install the latest version of the Angular CLI. We can follow these two steps to confirm that we have installed the latest version of Angular CLI.

# angular
npm install -g @angular/cli@latest
ng version

The first command will install the latest version of the CLI, and the second command will check the version of the installed Angular CLI. We can successfully install the latest version of Angular CLI by following these simple steps.

Rana Hasnain Khan avatar Rana Hasnain Khan avatar

Rana is a computer science graduate passionate about helping people to build and diagnose scalable web application problems and problems developers face across the full-stack.

LinkedIn

Related Article - Angular CLI