bower command not found


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?

1/28/2016 12:15:58 AM

Accepted Answer

Just like in this question (npm global path prefix) all you need is to set proper npm prefix.

$ npm config set prefix /usr/local
$ npm install -g bower

$ which bower
>> /usr/local/bin/bower

Then bower should be located just in your $PATH.

5/23/2017 12:10:41 PM

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

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow