我正在尝试构建我的项目,但是它失败了,有以下错误:
“运行命令-失败!运行cordova准备时出错(退出代码1):
Discovered plugin "cordova-plugin-insomnia" in config.xml. Adding it to the project
Failed to restore plugin "cordova-plugin-insomnia" from config.xml. You might need to try adding it again.
Error: Failed to fetch plugin
cordova-plugin-insomnia@git+https://github.com/EddyVerbruggen/Insomnia-PhoneGap-Plugin.git 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! git clone
C:\Users\<USER>\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-EddyVerbruggen-Insomnia-PhoneGap-Plugin-git-223我尝试使用以下方法安装cordova插件:
但是,这些命令都不起作用。
产生的错误如下:
npm错误!命令失败: git -c core.longpaths=true克隆C:\Users\AppData\Local\Temp\npm-6956-d2de50d1\git-cache-d4203f45\8d2c3b01fc0c11d9bc36bc1b5f9a141bd097f908 npm ERR!克隆入'C:\Users\AppData\Local\Temp\npm-6956-d2de50d1\git-cache-d4203f45\8d2c3b01fc0c11d9bc36bc1b5f9a141bd097f908'...npm错误!git-上传-包装'C:\Users\AppData\Roaming\npm-cache_git-remotes\git-https-github-com-EddyVerbruggen-Insomnia-PhoneGap-Plugin-git-223bcd2c':git-上传-包:命令不找到npm错误!致命:无法从远程存储库读取。npm错误!npm错误!请确保您有正确的访问权限npm错误!并且存储库存在。npm错误!npm错误!npm错误!如果您需要帮助,您可以报告此错误: npm!https://github.com/npm/npm/issues need!请包括以下文件与任何支持请求: npm!C:\Workspace\XXXXXX-mobile-app\node_modules\npm-debug.log将推送字符串数组{"name":"lang",“title”:"English (US)",“English (UK)",”value“:”en-us“,"en-gb"} android首选项文件已成功生成ios设置包。
我用的是以下版本-
发布于 2020-06-11 18:48:57
虽然这篇文章已经很老了,但是如果有人在寻找答案的话:
我确实删除了npm包和cordova插件的失眠。那么,ionic cordova prepare。最后,再次添加了-包和插件。
不知道,是什么破了,但成功了。
注:当时我使用的是离子3。新版本(v5)可能有包更新。
发布于 2017-11-12 20:21:32
这并不总是解决方案,但在类似的情况下,我只是运行了一点npm update,这是可以的。最后,您应该做一个ionic cordova platform remove ...,然后做一个ionic cordova platform add ...。
https://stackoverflow.com/questions/46000144
复制相似问题