Uninstalling bower installed with a different version of npm

Enrique Moreno Tent picture Enrique Moreno Tent · May 29, 2014 · Viewed 7.2k times · Source

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?)

Answer

isaacs picture isaacs · May 30, 2014

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