I seem to be getting the following when I execute npm install bower -g
/usr/local/share/npm/bin/bower -> /usr/local/share/npm/lib/node_module
In centos 6.8
vi ~/.zshrc
add three row below
export PATH=$HOME/bin:/usr/local/bin:$PATH
export PATH=/usr/bin:/bin:/usr/sbin:/sbin:$PATH
export PATH=/usr/local/share/npm/bin:$PATH
and then
exec /bin/zsh
or
exec /usr/bin/zsh
just work
If all of the above doesn't work, or you don't seem to understand the answers provided to the question.
I suggest you run the installation commands on your system command prompt and not git-bash, especially if your are on windows 8 or 7.
i add this
export PATH=$HOME/.node/bin:$PATH
at the end (and new line) of my .bash_profile file( located in user folder). Save it. close and reopen terminal
In Mac OS X add next row into your ~/.bash_profile
export PATH="$HOME/.node/lib/node_modules/bower/bin:$PATH"
And restart terminal or type:
source ~/.bash_profile
For users that are encountering issues with the installation in mac as shown in the official page, it seems that El Capitan is giving permission issues to install the package in that way:
npm install bower -g
The solution I've found to avoid the permission errors is using sudo
(superuser do) to provide access for node to download the package like this:
sudo npm install bower -g
Hopefully this may help users having the same problem. :)
If you used something other than Homebrew (yes, some of us actually did it weird) —like MacPorts, your $PATH
could be funky. Binaries may be located in other areas:
/opt/local/bin/grunt
and possibly /opt/local/bin/npm
Additionally if you use MacPorts to install npm then subsequently install bower, the binary will not be located where you'd expect. It actually ends up in your home directory under .npm/lib/node_modules/bower/bin
Your $PATH
should be adjusted in ~/.profile (Mac OS X) to add: $HOME/.npm/lib/node_modules/bower/bin
Source your Bash profile or open a new terminal window and it should be working.