How To Fix ng: command not found On A Mac

If you think you have installed angular but you still see issues, then try this:

1. Uninstall Everything

     npm uninstall -g angular-cli

     npm uninstall -g @angular/cli

     npm cache clean

2. Re-install

     npm install -g @angular/cli

Now have a look in your global NPM folder, it should be something like "/Users/j.jones/.npm-global/bin/". In here you should see your angular CLI files. To test if everything works, try typing:

     ng -v

If this does not work, then try manually adding an alias that mappings ng to your ng folder, like so:

     alias ng="/Users/j.jones/.npm-global/bin/ng"

I've also had issues where I have not had 'sudo' permissions. To get around this you can change your global path. To do this you can do something like this within your ~/.bash_profile :

    export PATH="$HOME/.npm-packages/bin:$PATH"

submit to reddit

Jon D Jones

Software Architect, Programmer and Technologist Jon Jones is founder and CEO of London-based tech firm Digital Prompt. He has been working in the field for nearly a decade, specializing in new technologies and technical solution research in the web business. A passionate blogger by heart , speaker & consultant from England.. always on the hunt for the next challenge

Back to top