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

守給你的承諾、 提交于 2020-01-13 02:50:32

问题


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?


回答1:


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 cordova@3.1.0

Check this documentation




回答2:


I'm not sure quite what you are looking for, but here are instructions on running multiple versions of cordova on the same machine: http://www.mooreds.com/wordpress/archives/1379

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.



来源:https://stackoverflow.com/questions/22152016/how-do-you-use-the-cordova-cli-to-add-a-specific-version-of-the-cordova-framewor

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!