39

I've been trying to install bower, but I must be missing something cause the command bower is not returning anything at all!

I installed bower like this:

sudo npm install bower -g

this is the output:

npm http GET https://registry.npmjs.org/bower
npm http 304 https://registry.npmjs.org/bower
npm http GET https://registry.npmjs.org/tmp
...
...  # Many requests here n_n
npm http GET https://registry.npmjs.org/traverse
npm http 304 https://registry.npmjs.org/traverse
/usr/bin/bower -> /usr/lib/node_modules/bower/bin/bower
bower@0.8.5 /usr/lib/node_modules/bower
├── stable@0.1.3
├── archy@0.0.2
├── colors@0.6.0-1
├── tmp@0.0.16
├── async@0.2.6
├── mkdirp@0.3.5
├── semver@1.1.4
├── request@2.11.4
├── hogan.js@2.0.0
├── lodash@1.0.1
├── rimraf@2.0.3 (graceful-fs@1.1.14)
├── nopt@2.0.0 (abbrev@1.0.4)
├── fstream@0.1.22 (inherits@1.0.0, graceful-fs@1.2.0)
├── promptly@0.1.0 (read@1.0.4)
├── tar@0.1.16 (inherits@1.0.0, block-stream@0.0.6)
├── read-package-json@0.1.13 (graceful-fs@1.2.0, lru-cache@2.0.4, slide@1.1.3, npmlog@0.0.2)
├── rc@0.0.8 (config-chain@0.3.3, optimist@0.3.5)
├── glob@3.1.21 (inherits@1.0.0, graceful-fs@1.2.0, minimatch@0.2.11)
└── unzip@0.1.4 (buffers@0.1.1, over@0.0.5, pullstream@0.1.0, setimmediate@1.0.1, readable-stream@0.2.0, binary@0.3.0)

seems ok..

but then I do bower --help and nothing happens, it doesn't show anything.. I've even tried a sudo bower --help

My nodejs version is v0.8.22 , npm version 1.2.14 on Ubuntu 12.10

Any ideas?? thanks in advance

pleasedontbelong
  • 19,542
  • 12
  • 53
  • 77

5 Answers5

124

Ok!!!

I found the problem... this is so stupid it made me laugh (even if i lost my night on this)

It seems that there's another software called "node" (Amateur Packet Radio Node program). I removed that software with sudo apt-get remove node, reinstalled nodeJS, then sudo npm install bower -g et voila!!!

So it seems that amateur packet radio people dont get along with web developpers... too bad.

starball
  • 20,030
  • 7
  • 43
  • 238
pleasedontbelong
  • 19,542
  • 12
  • 53
  • 77
  • I removed the "node" (Amateur Packet Radio Node program) and installed nodev0.10.28 and my problem solved. – Anand Gupta May 21 '14 at 06:01
  • it did help, I checked the software program in ubuntu and found that Node was that program. A little frustrating – corvid Aug 09 '14 at 15:57
  • 7
    Thank you, and I added symbolic link ```sudo ln -s /usr/bin/nodejs /usr/bin/node``` after removing the node (Amateur Packet Radio Node program) instead of reinstalling nodejs – gorodezkiy Aug 28 '14 at 00:32
  • 1
    Thanks, this was my problem, too! – avoliva Oct 23 '14 at 04:17
  • Wow. this is a shocker. I had to also add the link. surprising that ambiguous packages will default when installing – rbnzdave Feb 06 '15 at 03:24
  • I hope the folks at node are honest. They have an opportunity to fool all sorts of people into installing and running anything they want... – David Erwin Apr 10 '15 at 20:24
  • WT actual F. xD This made my day, we've been fixing this since yesterday. Oh my god. Thanks. – jofftiquez Jan 22 '16 at 10:36
2

Are you working behind a proxy? It seems bower doesn't automatically pick up proxy settings like npm does.

If you set the HTTP_PROXY and HTTPS_PROXY environment variables, then bower should work.

https://github.com/twitter/bower/issues/208

Note, they have to be upper case.

Derm

dermd
  • 167
  • 3
  • 13
  • non u_u Im not behind a proxy. Ive tried reinstalling node and npm like it says [here](https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager) – pleasedontbelong Mar 13 '13 at 22:13
  • my guess is that it has something to do with the user permission.. I've read that people had problems using sudo install -g – pleasedontbelong Mar 13 '13 at 23:33
2

Having the same issues.

All I did was edit the bower source code and alter the first line.

Fire up your terminal and jank this:

sudo nano `which bower`

Edit the first line that says:

#!/usr/bin/env node

And change it to:

#!/usr/bin/env nodejs

Make sure node (Amateur Packet Radio Node program) is not installed.

Viola that's it. Works for mint and ubuntu

quantum
  • 3,672
  • 29
  • 51
Jamaxiboy
  • 21
  • 2
1

Also make sure you're using a 'stable' version of nodejs; I also had this problem, turns out was caused by installing/using latest unstable build. Don't know whether it was a node issue, or an npm one (appears npm updates are packaged along w/ node).

(quick aside, use 'n' - https://github.com/visionmedia/n - to manage your node version...much less of a PITA ;))

Warren Davis
  • 333
  • 3
  • 4
1

I had similar issues on a mac, in the end updating my path for npm seemed to work:

export PATH=$PATH:/usr/local/share/npm/bin
Opentuned
  • 1,477
  • 17
  • 21