I tried to install twitter bower on my Mac, and I used
npm install bower -g
Then I tried bower --help
, and the output was bower command not found
. Why is that?
I tried to install twitter bower on my Mac, and I used
npm install bower -g
Then I tried bower --help
, and the output was bower command not found
. Why is that?
I am using node version manager. I was getting this error message because I had switched to a different version of node. When I switched back to the version of node where I installed bower, this error went away. In my case, the command was
nvm use stable
This turned out to NOT be a bower problem, though it showed up for me with bower.
It seems to be a node-which problem. If a file is in the path, but has the setuid/setgid bit set, which will not find it.
Here is a files with the s bit set: (unix 'which' will find it with no problems).
Here is a node-which attempt:
I change the permissions (chomd 755 git). Now node-which can find it.
Hope this helps.
Just like in this question (npm global path prefix) all you need is to set proper
npm prefix
.Then
bower
should be located just in your$PATH
.I am almost sure you are not actually getting it installed correctly. Since you are trying to install it globally, you will need to run it with sudo:
sudo npm install -g bower