Export $PATH permanently for JavaScript packages on Mac El Capitain.

I found a problem that after installing bower (and others , like gulp)globally via npm , I was not be able to use bower command in Terminal. I spent tons of time to figure out , and of cause it had been solved.

‘The packages did not know their own $PATH’

Here is our job.

  1. Create a folder which is a destination of installed packages via npm (for me , I named it npm-global).
  2. After that , go to Terminal and set $PATH in shell by typing
sudo nano /etc/paths

hit enter , type your computer’s password. It will access the shell GUI.

There is some $PATH (s) in there , you have to add the destination folder path to the shell GUI.

And save that change.

Check the job done by typing

echo $PATH

you will see the recently added path on Terminal. And Yeah , now you can use bower (or gulp) directly on Terminal.