Fix cordova update problems

The best solution is to
A. remove all existing installations of cordova, node and npm. Then
B. reinstall latest node
C. update npm
D. install latest cordova

A. To uninstall node and npm follow the steps –

1. Uninstall from Programs & Features with the uninstaller.

2. Reboot (or you probably can get away with killing all node-related processes from Task Manager).

3. Look for these folders and remove them (and their contents) if any still exist. Depending on the version you installed, UAC settings, and CPU architecture, these may or may not exist:
C:\Program Files (x86)\Nodejs
C:\Program Files\Nodejs
C:\Users\{User}\AppData\Roaming\npm (or %appdata%\npm)
C:\Users\{User}\AppData\Roaming\npm-cache (or %appdata%\npm-cache)
4. Reboot, for good measure.

B. Download latest version of node from https://nodejs.org/en/ and install it. npm version must be in the PATH variable
C. Update npm using command “npm install -g” for windows “sudo npm install -g” for mac and linux
D. Install latest version of cordova using the command “npm install -g cordova” for windows “sudo npm install -g cordova” for mac and linux

Leave a Comment