How do you use the Cordova CLI to add a specific version of the Cordova framework

Sani Elfishawy picture Sani Elfishawy · Mar 3, 2014 · Viewed 14.4k times · Source

Cordova provides a CLI for instantiating and building a Cordova framework.

For example you can type:

cordova create ...

to create the directory structure for building a Cordova app.

You can also type:

cordova platform add android
cordova plugin add ...
cordova build android

to add the files for an android project, add plugins and build it.

These commands however seem to add the latest version of Cordova itself currently cordova3.4.0. What if you wanted to build with an earlier, post 3.0, version of Cordova like cordova3.1.0. How would you do that?

Answer

Divesh Salian picture Divesh Salian · Mar 4, 2014

From node.js run this command sudo npm uninstall cordova -g to uninstall the current version and to install the specific version run this command sudo npm install -g [email protected]

Check this documentation