Skip to content

npm update -g bower does not update bower #5248

Closed
siddhion opened this Issue May 9, 2014 · 8 comments

4 participants

@siddhion
siddhion commented May 9, 2014

I ran bower init and saw a message to update to bower 1.3.3

$ bower init
-----------------------------------------
Update available: 1.3.3 (current: 1.2.8)
Run npm update -g bower to update
-----------------------------------------

I tried to do that and it did not work. How can I get global bower to update?

$ sudo npm update -g bower
[sudo] password for max: 
npm http GET https://registry.npmjs.org/bower
npm http 304 https://registry.npmjs.org/bower

$ bower -g -v
1.2.8
@bfred-it

I've been having the exact same issue. Won't update from 1.2.8 to 1.3.3

I tried uninstalling it but it won't do that either. I feel that it's a configuration issue.

bfred@fb /> npm uninstall -g bower
npm WARN uninstall not installed in /Users/bfred/.node/lib/node_modules: "bower"

bfred@fb /> which bower
/usr/local/bin/bower

bfred@fb /> echo $PATH
/usr/bin /bin /usr/sbin /sbin /usr/local/bin /Users/bfred/bin /Users/bfred/.node/bin
@siddhion

I tried uninstalling

$ sudo npm uninstall -g bower
[sudo] password for max: 
unbuild bower@1.3.3

it says unbuild bower@1.3.3 but I had 1.2.8. Very confusing. When I reinstalled this is what I got:

https://gist.github.com/siddhion/5d8639697b631910e963

On line 323-324 I see

/usr/bin/bower -> /usr/lib/node_modules/bower/bin/bower
bower@1.3.3 /usr/lib/node_modules/bower

So bower@1.3.3 seems to be getting installed but when I check the version I get

$ bower --version
1.2.8

Still at 1.2.8. Any ideas?

@siddhion
siddhion commented Jun 5, 2014

Well I fixed this manually. Here is what I did.

First I tried uninstalling

$ sudo npm uninstall -g bower
[sudo] password for max: 
unbuild bower@1.3.3

It says it unbuilt version 1.3.3 ok. So more verification I had 1.3.3 and not 1.2.8. I then decided to check if bower really bounced

$ bower --version
1.2.8

$ which bower
/usr/local/bin/bower

Ehh. Guess not so I went in manually to clean it out by going into /usr/local/bin/bower
and finding out where the symbolic link was pointing to so

$ ls -l
total 2844
lrwxrwxrwx 1 root root      35 Jan 17 02:09 bower -> ../lib/node_modules/bower/bin/bower

I deleted the symbolic link with sudo rm bower and traveled to /usr/local/lib/node_modules/bower/bin and ran sudo rm -rf bower/
. Bye bye bower.

$ bower --version
bash: /usr/local/bin/bower: No such file or directory

Now I just had to reinstall bower with `sudo npm install -g bower' but when I checked to see if the new globally installed bower was there I got

$ bower --version
bash: /usr/local/bin/bower: No such file or directory

I just had to open a new terminal and finally success

$ bower --version
1.3.4

Not a true fix but hope that helps some frustrated people out there.

@bfred-it
bfred-it commented Jun 5, 2014

Yep, that fixed it for now:

rm /usr/local/bin/bower
npm install -g bower
@siddhion
siddhion commented Jun 5, 2014

Not sure if this calls for a closing of this issue as the problem was not fully solved. This is just a manual work around. What do you think?

@bfred-it
bfred-it commented Jun 7, 2014

The problem was probably in our own configuration, so it can be closed. If anyone has the same problem they'll find this and fix it themselves.

@siddhion siddhion closed this Jun 7, 2014
@numediaweb

What worked for me is to manually remove the bower components/folders from the system, to do so, and as I'm running in windows, I did;
where bower
if you are in unix then use:
which bower
this shows the directories where bower is installed, just delete them using super user access.
now if you type this:
bower -v
you should get an error if not then you still have bower installed!
once you have removed bower, reset the nodejs cash by:
rm -rf ~/.npm
npm cache clear
Then install the new version of bower:
npm install -g bower

@hgezim
hgezim commented Sep 28, 2015

I had a similar issue and discovered it had to do with the prefix config in npm. Here's the solution: http://stackoverflow.com/questions/32803198/changing-node-version-used-by-npm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.