Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Uninstalling bower installed with a different version of npm

I have an Ubuntu 14.04 system. I had installed npm and I installed bower using

sudo npm install -g bower

Some time after that I realized that I was using the node and npm that came fromt he ubuntu repositories, so to use the latest one, I added the repository:

$ sudo add-apt-repository ppa:chris-lea/node.js

and update the packages.

Now I was trying to uninstall bower from the system, but guess what? I get this:

$ sudo npm remove -g bower
npm WARN uninstall not installed in /usr/lib/node_modules: "bower"

So, wait, what? It cant find Bower? So I try to make

which bower

and the output here is:

/usr/local/bin/bower

I dont really understand what is going on. I suspect that I have a problem with different versions of npm and nodejs not playing nice together, since I installed bower with a different version of npm that the one I have installed now. Any idea of how I could uninstall Bower now? (Or at least come back to a clean state, so that I can begin from the beginning?)

like image 581
Enrique Moreno Tent Avatar asked May 29 '14 17:05

Enrique Moreno Tent


People also ask

How do I uninstall npm Bower?

Uninstall packages If you use the bower. json file, remove the package from this file and launch bower install again. It will not remove it, you have to use the bower uninstall command.

Can I use npm instead of Bower?

In almost all cases, it's more appropriate to use Browserify and npm over Bower. It is simply a better packaging solution for front-end apps than Bower is. At Spotify, we use npm to package entire web modules (html, css, js) and it works very well.

How uninstall the npm installed package?

To remove a package with the npm uninstall command, you can use the syntax npm uninstall package-name in the directory where the package is located.


1 Answers

sudo npm uninstall bower -g --prefix=/usr/local

like image 86
isaacs Avatar answered Oct 20 '22 20:10

isaacs