- Remove all npm uninstall -g angular-cli
npm uninstall -g @angular/cli npm cache clean
- Reinstall
npm install -g @angular/cli
Now look into your global NPM folder, it should be something like "/Users//.npm-global/bin/". Here you should see your corner CLI files. To check if everything works, try typing:
ng -v
If this does not work, try manually adding an alias that displays ng to your ng folder, for example like this:
alias ng="/Users/<username>/.npm-global/bin/ng"
I also had problems when I did not have 'sudo' permissions. To get around this, you can change your global path. To do this, you can do something like this in your ~ / .bash_profile:
export PATH="$HOME/.npm-packages/bin:$PATH"
Taken from here
manish kumar
source share