Cordova 插件问题 CordovaError: Version of installed plugin: "cordova-plugin-file@4.3.3" 不满足依赖插

Posted

技术标签:

【中文标题】Cordova 插件问题 CordovaError: Version of installed plugin: "cordova-plugin-file@4.3.3" 不满足依赖插件要求【英文标题】:Cordova plugin problems CordovaError: Version of installed plugin: "cordova-plugin-file@4.3.3" does not satisfy dependency plugin requirement 【发布时间】:2018-10-30 03:30:48 【问题描述】:

我在使用 Cordova 插件做噩梦。

无法安装“cordova-plugin-file-transfer”:CordovaError: 已安装插件的版本:“cordova-plugin-file@4.3.3”不 满足依赖插件要求“cordova-plugin-file@>=5.0.0”。 尝试 --force 使用已安装的插件作为依赖项。

依赖关系

  "dependencies": 
    "android": "0.0.8",
    "com.rjfun.cordova.httpd": "https://github.com/floatinghotpot/cordova-httpd.git",
    "cordova-android": "^6.3.0",
    "cordova-browser": "^5.0.4",
    "cordova-media-with-compression": "~2.1.1",
    "cordova-plugin-android-permissions": "~1.0.0",
    "cordova-plugin-compat": "^1.2.0",
    "cordova-plugin-file": "~5.0.0",
    "cordova-plugin-file-downloader": "^0.3.2",
    "cordova-plugin-file-md5": "^0.3.3",
    "cordova-plugin-file-transfer": "^1.7.1",
    "cordova-plugin-fullscreen": "~1.1.0",
    "cordova-plugin-insomnia": "git+https://github.com/EddyVerbruggen/Insomnia-PhoneGap-Plugin.git",
    "cordova-plugin-network-information": "^2.0.1",
    "cordova-plugin-speechrecognition": "~1.1.2",
    "cordova-plugin-webserver": "git+https://github.com/bykof/cordova-plugin-webserver.git",
    "cordova-plugin-whitelist": "~1.3.3",
    "cordova-plugin-zip": "^3.1.0",
    "cordova-sqlite-storage": "~2.3.3"
  

配置.xml

<plugin name="cordova-plugin-fullscreen" spec="~1.1.0" />
<plugin name="com.rjfun.cordova.httpd" spec="https://github.com/floatinghotpot/cordova-httpd.git" />
<plugin name="cordova-plugin-android-permissions" spec="~1.0.0" />
<plugin name="cordova-media-with-compression" spec="~2.1.1" />
<plugin name="cordova-plugin-file-downloader" spec="^0.3.2" />
<plugin name="cordova-plugin-file" spec="~5.0.0" />
<plugin name="cordova-plugin-file-transfer" spec="^1.7.1" />
<plugin name="cordova-plugin-insomnia" spec="https://github.com/EddyVerbruggen/Insomnia-PhoneGap-Plugin.git" />
<plugin name="cordova-sqlite-storage" spec="~2.3.3" />
<plugin name="cordova-plugin-speechrecognition" spec="~1.1.2" />
<plugin name="cordova-plugin-webserver" spec="https://github.com/bykof/cordova-plugin-webserver.git" />
<plugin name="cordova-plugin-whitelist" spec="~1.3.3" />

我已经尽我所能升级插件,删除它,添加它 - 清除所有插件等。

没有什么可以解决这个问题。

我该如何克服这个问题?

【问题讨论】:

【参考方案1】:

您的 plugin-flie 版本似乎在文件传输之前尝试这样做(离子 3)

ionic cordova plugin add cordova-plugin-file
npm install --save @ionic-native/file@4.3.3

ionic cordova plugin add cordova-plugin-file-transfer --force
ionic cordova plugin add cordova-plugin-file-transfer@4.3.3

【讨论】:

以上是关于Cordova 插件问题 CordovaError: Version of installed plugin: "cordova-plugin-file@4.3.3" 不满足依赖插的主要内容,如果未能解决你的问题,请参考以下文章

CordovaError:插件无效! ..\hello 需要一个有效的 package.json

cordova-plugin-adam-wechat 插件安装

cordova-plugin-adam-wechat 插件安装

cordova-plugin-adam-wechat 插件安装

关于启动cordova项目 报CordovaError: No emulator images (avds) found

Cordova - CordovaError: Promise rejected with non-error: 'ios-deploy was not found