I am trying to run ng build in my project folder, but I get the following response:
bash: ng: command not found
Wha
This was a pain to figure out, so here is my solution
1. npm install -g @angular/cli
2. Make sure the ng path is correct
* cd ~/npm-global/bin
* ls and make sure ng exists here!
3. create .bashrc or .bash_profile or .bash_everything file on your home directory with:
* touch ~/.bash_profile
open this file with text editor or Sublime or vi or etc.
* open -e .bash_profile
4. Add ng as alias
* writing this:
alias ng="~/npm-global/bin/ng" or alias ng="MyFullPAThere/npm-global/bin/ng"
* save file and close text editor.
5. Temporarily Update . bash_profile reference
Your terminal wont take bash updates until a restart but the following command will let you use the updates during the terminal session:
* source ~/.bash_profile
6. Check that ng works
* ng --version
Hope that helps someone!