Cordova-plugin-file@6.0.2" does not satisfy dependency plugin requirement "cordova-plugin-file@^4.0.0

Hi Team,

I am uploading the file and getting the error message as below :

“UserError: CordovaError: Version of installed plugin: “cordova-plugin-file@6.0.2” does not satisfy dependency plugin requirement “cordova-plugin-file@^4.0.0”. Try --force to use installed plugin as dependency.”

I had tried a lot of the version but still the same error. Please help me.


Can you share the dependencies in your package.json and config.xml?

“dependencies”: {
“cordova-browser”: “^6.0.0”,
“cordova-plugin-camera”: “^4.1.0”,
“cordova-plugin-file”: “^6.0.2”,
“cordova-plugin-inappbrowser”: “^3.2.0”,
“cordova-plugin-whitelist”: “^1.3.4”
Below is config: <plugin name='cordova-plugin-file" source=“npm” />

Do you have any other plugins listed in your config.xml?

    <gap:platform name="ios" />
    <gap:platform name="android" />
    <gap:plugin name="cordova-plugin-whitelist" source="npm" />
    <plugin name="cordova-plugin-camera" version="5.0.1" source="npm" />
    <gap:plugin name="cordova-plugin-device" spec="1.1.7" source="npm" />
    <gap:plugin name="cordova-plugin-dialogs" spec="1.3.4" source="npm" />
    <gap:plugin name="phonegap-plugin-barcodescanner" source="npm" version="3.1.2" />
    <plugin name="cordova-plugin-file" source="npm" />
    <plugin name="cordova-plugin-file-transfer" version="1.7.1" source="npm" />
    <gap:plugin name="cordova-plugin-geolocation" spec="2" source="npm" />        
    <gap:plugin name="cordova-plugin-media-capture" spec="1" source="npm" />
    <gap:plugin name="cordova-plugin-network-information" spec="1.3.4" source="npm" />
    <gap:plugin name="cordova-plugin-splashscreen" spec="4.1.0" source="npm" />        
	<plugin name="cordova-sqlite-storage" source="npm" version="6.0.0" />

You’re using an old version of cordova-plugin-media-capture (spec="1", which I assume means any 1.x version) which depends on cordova-plugin-file@^4.0.0. This means it will work with any 4.x version, but nothing higher. You have a couple of options:

  1. Use an 4.x version of cordova-plugin-file (e.g. ^4.3.3)
  2. Use a more recent version of cordova-plugin-media-capture (e.g. ^3.0.3)