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_modules/bower/bin/bower
bower@0.8.6 /usr/local/share/npm/lib/node_modules/bower
Unfortunately executing any of the bower commands returns -bash: bower: command not found
which npm
returns /usr/local/bin/npm
and running which node
returns /usr/local/bin/node
.
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
If you have a 'non standard' installation, you need to find the node bin location location with:
Then add the node bin location to your
~/.bash_profile
export PATH=<yourNodeBinLocation>:$PATH
Remember to open a new terminal to test, or
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. :)
As of September 2016, the .pkg installer from nodejs.org arranges for installed packages to be under
$HOME/.npm-packages/lib/node-modules
, with symlinks in~/.npm-packages/bin
:In centos 6.8
add three row below
and then
or
just work