我试图在Visual Studio 2015中为我的cordova应用程序安装插件给出错误:
Couldn't download plugin.
如果我尝试使用CLI安装它错误是:
Current Directory is not cordova based project
npm install -g cordova
cordova start project_name
cordova plugin add org.apache.cordova.file
更新配置文件
<vs:plugin name="org.apache.cordova.file" version="1.3.1" />
要么
只需在Config.xml中添加以下行 .
<vs:features> <vs:feature>https://github.com/phonegap-build/PushPlugin.git</vs:feature> </vs:features>
构建项目并观察bld / debug / plugins文件夹
两种方法之一应该适合你
目前Cordova插件官方存储库中的插件历史存在问题,可能会导致此错误 .
使用git URI来获取最新插件,方法是将其输入自定义选项卡 .
例如:https://git-wip-us.apache.org/repos/asf/cordova-plugin-device.git
你可以在这里找到git URI:http://plugins.cordova.io/#/package/org.apache.cordova.device
Update 2/16 12:55pm PT: Plugin history is in the process of being restored. VS pinned plugins are working as of this time. You should no longer need to use this workaround.
不太清楚是什么打破了这个,但这个解决方法应该做的伎俩:
在命令行:
> npm install -g cordova > mkdir cordovaTemp > cd cordovaTemp > cordova create . > cordova plugin add org.apache.cordova.device
接下来,将cordovaTemp / plugins子文件夹复制并粘贴到项目的/ plugins文件夹中,然后在Visual Studio中执行以下操作:
打开config.xml文件
导航到插件>自定义
选择本地单选按钮
单击...图标以浏览项目插件文件夹下的新子文件夹
希望能帮助到你 .
我遇到了这个问题 . 即使手动添加git地址 config.xml 也不适合我 .
config.xml
问题是我在公司代理的后面,即使我的npm和visual studio配置为该代理,我的git也没有,这个过程使用git clone功能 .
要解决我只需要在我的git中添加我的代理配置:
git config --global http.proxy http://username:password@my.proxy.com:1234 git config --global https.proxy http://username:password@my.proxy.com:1234
使用带有Cordova Tools的Visual Studio 2013 Update 4时遇到了同样的问题 . 我也是公司代理的后面,在尝试了上述解决方案后,我必须创建HTTP_PROXY和HTTPS_PROXY环境变量 .
HTTP_PROXY = http://username:password@proxyhost:proxyportHTTPS_PROXY = http://username:password@proxyhost:proxyport您的用户名:密码是您的登录凭据 .
我的视觉工作室,npm和git代理设置也已设置 .
5 回答
npm install -g cordova
cordova start project_name
cordova plugin add org.apache.cordova.file
更新配置文件
要么
只需在Config.xml中添加以下行 .
构建项目并观察bld / debug / plugins文件夹
两种方法之一应该适合你
目前Cordova插件官方存储库中的插件历史存在问题,可能会导致此错误 .
使用git URI来获取最新插件,方法是将其输入自定义选项卡 .
例如:https://git-wip-us.apache.org/repos/asf/cordova-plugin-device.git
你可以在这里找到git URI:http://plugins.cordova.io/#/package/org.apache.cordova.device
Update 2/16 12:55pm PT: Plugin history is in the process of being restored. VS pinned plugins are working as of this time. You should no longer need to use this workaround.
不太清楚是什么打破了这个,但这个解决方法应该做的伎俩:
在命令行:
接下来,将cordovaTemp / plugins子文件夹复制并粘贴到项目的/ plugins文件夹中,然后在Visual Studio中执行以下操作:
打开config.xml文件
导航到插件>自定义
选择本地单选按钮
单击...图标以浏览项目插件文件夹下的新子文件夹
希望能帮助到你 .
我遇到了这个问题 . 即使手动添加git地址
config.xml
也不适合我 .问题是我在公司代理的后面,即使我的npm和visual studio配置为该代理,我的git也没有,这个过程使用git clone功能 .
要解决我只需要在我的git中添加我的代理配置:
使用带有Cordova Tools的Visual Studio 2013 Update 4时遇到了同样的问题 . 我也是公司代理的后面,在尝试了上述解决方案后,我必须创建HTTP_PROXY和HTTPS_PROXY环境变量 .
HTTP_PROXY = http://username:password@proxyhost:proxyport
HTTPS_PROXY = http://username:password@proxyhost:proxyport
您的用户名:密码是您的登录凭据 .
我的视觉工作室,npm和git代理设置也已设置 .