44

I've installed cordova via npm and i did it globally, now i would like to remove it to reinstall it on single app folder

Any clue on how to do it safely?

Rimian
  • 36,864
  • 16
  • 117
  • 117
itsme
  • 48,972
  • 96
  • 224
  • 345

6 Answers6

87

Try sudo npm uninstall cordova -g to uninstall it globally and then just npm install cordova without the -g flag after cding to the local app directory

enducat
  • 1,676
  • 3
  • 17
  • 16
28

Try this for Windows:

    npm uninstall -g cordova

Try this for MAC:

    sudo npm uninstall -g cordova

You can also add Cordova like this:

  1. If You Want To install the previous version of Cordova through the Node Package Manager (npm):

    npm install -g cordova@3.6.3-0.2.13
    
  2. If You Want To install the latest version of Cordova:

    npm install -g cordova 
    

Enjoy!

19

Super late here and I still couldn't uninstall using sudo as the other answers suggest. What did it for me was checking where cordova was installed by running

which cordova

it will output something like this

/usr/local/bin/

then removing by

rm -rf /usr/local/bin/cordova
garrettmac
  • 8,417
  • 3
  • 41
  • 60
3

This can happen when the cordova was installed globally on a different version of the node.

Being necessary to manually delete yourself as suggested in the previous comment:

which cordova

it will output something like this

/usr/local/bin/

then removing by

rm -rf /usr/local/bin/cordova

0

worked for me:

which cordova

/opt/homebrew/bin/cordova

rm -rf /opt/homebrew/bin/cordova
FAOZI
  • 67
  • 6
0

For those using multiple node versions (say via nvm), you wont be able to uninstall if Cordova is installed against some other node version than the currently checked out version so switch to all other node versions respectively and run the command to get the job done

npm uninstall -g cordova
Abdullah Sohail
  • 355
  • 4
  • 8