18

I am trying to install packages with bower. No matter what package I seem to try to install, bower outputs nothing and hangs. The verbose flag does not give more information.

strace outputs a long series of:

gettimeofday({1401644126, 563885}, NULL) = 0
gettimeofday({1401644126, 563944}, NULL) = 0
futex(0xb720046c, FUTEX_WAKE_PRIVATE, 1) = 1

And lsof outputs:

strace  19125 matt  rtd    DIR    8,6     4096       2 /
strace  19125 matt  txt    REG    8,6   264024 3550363 /usr/bin/strace
strace  19125 matt  mem    REG    8,6  1758972  263074 /lib/i386-linux-gnu/libc-2.19.so
strace  19125 matt  mem    REG    8,6   134380  264066 /lib/i386-linux-gnu/ld-2.19.so
strace  19125 matt    0u   CHR 136,15      0t0      18 /dev/pts/15
strace  19125 matt    1u   CHR 136,15      0t0      18 /dev/pts/15
strace  19125 matt    2u   CHR 136,15      0t0      18 /dev/pts/15

npm is version 1.4.13 and bower is 1.3.3.

The expected behavior is that the package be installed. Any idea what is happening?

Matt
  • 800
  • 1
  • 7
  • 15

3 Answers3

16

I believe this problem is fixed by commit 23fbbb51915d532a23ce0faafcc140663fbc008e.

Re-installing bower from master fixed the problem:

sudo npm install -g git://github.com/bower/bower#master
Matt
  • 800
  • 1
  • 7
  • 15
16

In my case it was not working well with the git protocol (which uses port 9418 was blocked). I ended up forcing git to use https.

git config --global url.https://.insteadOf git://

now it works. Hope this helps someone.

kratos
  • 2,465
  • 2
  • 27
  • 45
5

I know this is an old issue but I was having the same problem today using bower to install angular sanitize, and wanted to add my two cents, in case someone has this issue again. Not sure if this is the best solution but it worked. I added the force flag

bower install --force

you can also try before:

bower cache clean

bower cache list

Also I deleted the libraries that bower had pulled in previously

Mariano_Stanco
  • 171
  • 2
  • 7
  • 1
    Thats how I solved my problem too (one dependency responded with 504). Here's a detailed explanation: https://github.com/bower/bower/issues/1899#issuecomment-308363902 – DJDaveMark Jun 14 '17 at 09:03