cordova插件安装由于网络原因,经常会出来插件安装失败的情况
于是在网站搜索了一个下载包来安装,不用在线装
Error: Failed to fetch plugin cordova-plugin-wechat@2.0.0 via registry.
Probably this is either a connection problem, or plugin spec is incorrect.
Check your connection and plugin name/version/URL.
Error: cmd: Command failed with exit code 1 Error output:
npm ERR! shasum check failed for C:UsersADMINI~1AppDataLocalTempnpm-9128-2b5ab054registry.npmjs.orgcordova-plugin-wechat-cordova-plugin-wechat-2.0.0.tgz
npm ERR! Expected: af24ac74abf3d32ca3729fe46c4b7f981816b2e5
npm ERR! Actual: aa642877eda312fd352f04153c583ab334235256
npm ERR! From: https://registry.npmjs.org/cordova-plugin-wechat/-/cordova-plugin-wechat-2.0.0.tgz
npm ERR! A complete log of this run can be found in:
npm ERR! D:Program Filesnodejscache_logs2017-08-03T04_43_55_012Z-debug.log
以实际情况操作:
下载cordova微信支付插件
https://registry.npmjs.org/cordova-plugin-wechat/-/cordova-plugin-wechat-2.0.0.tgz
解压,里面是一个package文件夹
在cordova项目文件夹下执行
cordova plugin add E:wwwrootVuecordova-plugin-wechat --variable wechatappid=xxxxxx
安装成功
还有可以直接git链接来安装的
参考链接:
http://www.cnblogs.com/huangenai/p/6840333.html