Can I install a previous version of a plugin using the cordova plugin add command?

百般思念 提交于 2019-12-03 08:08:44

问题


I am trying to rebuild a cordova project from scratch and creating documentation along the way. I would like to be able to install consistent versions of plugins to avoid having to retest new code for the time being. Is there a way to specify a previous version of a plugin similar to the way you can specify a previous version of cordova? For example, I am familiar with the following syntax to install a specific version of cordova:

npm install -g cordova@3.1

And I'm able to install a plugin with the following syntax:

cordova plugin add org.apache.cordova.device

I would like to be able to so something like the following:

cordova plugin add org.apache.cordova.device@2.1

Any insight including "not possible" would be helpful. Thanks!


回答1:


from official cordova website

http://cordova.apache.org/news/2013/10/21/cordova-registry.html

From anywhere within an app’s directory, plugins can be added to a project with

cordova plugin add [PLUGIN_ID]

where PLUGIN_ID is the id (typically reverse-domain style) shown on the plugin registry website. You can also download a specific version of a plugin:

cordova plugin add [PLUGIN_ID]@[VERSION]



回答2:


I had a similar problem with a plugin. This is how it worked for me:

Usually I would have added the plugin like this

cordova plugin add org.apache.cordova.contacts

Instead I fetched the plugin from github like this (note the version tag at the end)

cordova plugin add https://github.com/apache/cordova-plugin-contacts#1.1.0


来源:https://stackoverflow.com/questions/21391431/can-i-install-a-previous-version-of-a-plugin-using-the-cordova-plugin-add-comman

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