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 ?
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 .
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With