Problems updating bower to the latest version

I am using conversation

$ bower -v 0.9.2 

The latest version of bower is 1.xx https://github.com/bower/bower/releases

I am running a bower update to the latest version

 npm update -g bower 

It does not help

I still have

 $ bower -v 0.9.2 
+55
npm bower bower-install
Mar 23 '14 at 1:09
source share
3 answers

1) you need to clear npm cache and then update bower

 sudo npm cache clean npm update -g bower 

2) If the 1st solution does not help

try uninstalling and installing it again

 npm -g uninstall bower npm -g install bower 

check still here

 which bower 

if he shows you something like

 /usr/local/bin/bower 

then

 rm <path from previous command> 

and after installation again

 npm -g install bower 

open a new bash window and get the latest bower

the same will help with other packages

+91
Mar 23 '14 at 1:09
source share

There can be many moving parts. You must try first

 npm cache clean sudo npm cache clean npm update -g bower 

... which - all moving parts - is unlikely to work for you.

On a Mac, using brew and nvm with some history, you would do something like this:

1. find out where the gazebo is now

  $ which bower /usr/local/share/npm/bin/bower $ ls -hal /usr/local/share/npm/bin/bower lrwxr-xr-x 1 iwein admin 35B Dec 15 2013 /usr/local/share/npm/bin/bower -> ../lib/node_modules/bower/bin/bower $ ls -hal /usr/local/share/npm/lib/node_modules/bower/bin/bower -rwxr-xr-x 1 iwein staff 3.3K Sep 17 2013 /usr/local/share/npm/lib/node_modules/bower/bin/bower $ bower -v 1.2.8 $ rm -rf /usr/local/share/npm/lib/node_modules/bower 

2. reinstall conversation using npm

  $ npm install -g bower /Users/iwein/.nvm/v5.11.1/bin/bower -> /Users/iwein/.nvm/v5.11.1/lib/node_modules/bower/bin/bower /Users/iwein/.nvm/v5.11.1/lib └── bower@1.7.9 $ bower -v bash: /usr/local/share/npm/bin/bower: No such file or directory $ which bower /Users/iwein/.nvm/v5.11.1/bin/bower $ bower bash: /usr/local/share/npm/bin/bower: No such file or directory $ ls -hal ~/.nvm/v5.11.1/bin/bower lrwxr-xr-x 1 iwein staff 35B Jun 1 11:53 /Users/iwein/.nvm/v5.11.1/bin/bower -> ../lib/node_modules/bower/bin/bower 

3. open a new terminal

... or the source of your .profile or something else. Check if you are using the same version of node (implying a different version of nvm if you do not)

  $ which bower /Users/iwein/.nvm/v0.10.24/bin/bower $ bower -v 1.4.1 $ nvm use 5 Now using node v5.11.1 $ which bower /Users/iwein/.nvm/v5.11.1/bin/bower $ bower -v 1.7.9 

And you are good.

Note that:

  • you need to make sure that you are installing in the right place, you may need several versions of bower, nvm, npm or node for your system for different projects ...
  • you need to restart the terminal to make sure the connection is made correctly.
+1
Jun 01 '16 at 10:11
source share

The bower update was probably working fine, it just wasn’t in the var update environment.

On my Ubuntu there was something like:

 ln -sf /usr/local/n/versions/node/6.2.0/bin/bower /usr/bin/bower 
0
May 31 '16 at 13:09
source share



All Articles