cordova 安装插件失败

问题如下:

G:\Work\AMC>cordova plugin add cordova-plugin-app-version
(node:9884) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): CordovaError: Failed to fetch plugin cordova-plugi
n-app-version 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 4294963238 Error output:
npm WARN myapp@1.1.1 No repository field.
npm WARN myapp@1.1.1 No license field.

npm ERR! path G:\Work\AMC\node_modules\_glob@7.1.3@glob\node_modules\fs.realpath
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename 'G:\Work\AMC\node_modules\_glob@7.1.3@glob\node_modules\fs.realpath' -> 'G:\Work\AMC\
node_modules\_glob@7.1.3@glob\node_modules\fs.realpath'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     D:\Nodejs\node_cache\_logs\2018-09-21T14_58_53_089Z-debug.log
(node:9884) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled w
ill terminate the Node.js process with a non-zero exit code.

重点信息如下:

UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1):
CordovaError: Failed to fetch plugin cordova-plugin-app-version via registry.
Probably this is either a connection problem, or plugin spec is incorrect.
Check your connection and plugin name/version/URL.

解决方法如下:

把代码中与 该插件相关的部分代码注释掉,在下载就可以了

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • Android 自定义View的各种姿势1 Activity的显示之ViewRootImpl详解 Activity...
    passiontim阅读 175,209评论 25 709
  • 用两张图告诉你,为什么你的 App 会卡顿? - Android - 掘金 Cover 有什么料? 从这篇文章中你...
    hw1212阅读 14,467评论 2 59
  • Spring Cloud为开发人员提供了快速构建分布式系统中一些常见模式的工具(例如配置管理,服务发现,断路器,智...
    卡卡罗2017阅读 135,337评论 19 139
  • 1、通过CocoaPods安装项目名称项目信息 AFNetworking网络请求组件 FMDB本地数据库组件 SD...
    阳明AI阅读 16,039评论 3 119
  • 庄子在《养生主》中讲了这样一句话:“吾生也有涯,而知也无涯,以有涯随无涯,殆矣。已而为知者,殆而已矣。”已经知道这...
    匆匆那年没留住阅读 1,085评论 1 0