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.