npm install -g @angular/cli is not working

Recently while working with angular 5 project my angular/cli was corrupted. I was trying to repair the CLI by re-installing like this

npm install -g @angular/cli

But it was not installing the cli.

I fixed the problem like this

Step 1: Go to visual studio terminal and type the command like this
npm uninstall -g angular-cli

Step 2: Clear the cache using this command
npm cache clear –force

Step 3: Remove the roaming folder from this location
a. C:\Users\\AppData\Roaming\npm\
b. C:\Users\\AppData\Roaming\npm-cache

Step 4: Install the latest cli like this

npm install -g @angular/cli@latest

I hope this will help to some one.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.