Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to maintain multiple cordova versions in development system?

How can we maintain multiple versions of Cordova in a system . We develop multiple applications and my system currently runs 3.6.3-0.2.12 . But another application that is in development works only upto Cordova v3.5. Is it possible to maintain multiple versions of cordova in one system ?

like image 750
user3592479 Avatar asked Sep 18 '14 11:09

user3592479


People also ask

How do I install a specific version of cordova?

Short version, use the npm install cordova@[version] command to install cordova in the current directory, and use the cordova command in node_modules/cordova/bin for all your project commands. To find out the available versions of cordova, run npm view cordova .

Which switch is used for global installation in cordova?

The -g flag above tells npm to install cordova globally. Otherwise it will be installed in the node_modules subdirectory of the current working directory. You may need to add the npm directory to your PATH in order to invoke globally installed npm modules.


1 Answers

You can do it. Typically, you would install cordova globally with npm install -g cordova. This install drops an executable in the global npm directory that is in your PATH and the application is ready to use. You can install the cordova cli locally with npm install --save [email protected] which will install the CLI tool in the working directory at ./node_modules/cordova and add the dependency to your package.json

Now (on a windows machine at least) there is a hidden .bin directory in the node_modules folder. You can access the local cordova cli here

node_modules/.bin/cordova.cmd create myproject com.site.myprojectMyProject

You could create a script in your project's root folder to relay commands to the local install.

like image 93
kindasimple Avatar answered Sep 28 '22 18:09

kindasimple