Error installing file transfer plugin


#1

During the build i got this error:

Installing "cordova-plugin-file-transfer" for ios

Failed to install 'cordova-plugin-file-transfer': CordovaError: Version of installed plugin: "cordova-plugin-file@6.0.1" does not satisfy dependency plugin requirement "cordova-plugin-file@^5.0.0". Try --force to use installed plugin as dependency.
    at /Users/ninja/.nvm/versions/node/v9.4.0/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:557:37
    at _fulfilled (/Users/ninja/.nvm/versions/node/v9.4.0/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/q/q.js:787:54)
    at self.promiseDispatch.done (/Users/ninja/.nvm/versions/node/v9.4.0/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/q/q.js:816:30)
    at Promise.promise.promiseDispatch (/Users/ninja/.nvm/versions/node/v9.4.0/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/q/q.js:749:13)
    at /Users/ninja/.nvm/versions/node/v9.4.0/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/q/q.js:509:49
    at flush (/Users/ninja/.nvm/versions/node/v9.4.0/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/q/q.js:108:17)
    at process._tickCallback (internal/process/next_tick.js:150:11)

Failed to restore plugin "cordova-plugin-file-transfer" from config.xml. You might need to try adding it again. Error: Version of installed plugin: "cordova-plugin-file@6.0.1" does not satisfy dependency plugin requirement "cordova-plugin-file@^5.0.0". Try --force to use installed plugin as dependency.

--save flag or autosave detected

Ionic version: 3,
ionic cli 3.19.1,
mac os high sierra 10.13.2

Anyone knows how to fix this?


#2

Are you trying to install the deprecated plugin?


#3

Hi @AaronSterling, thanks for the reply.

When searching for file upload on ionic there are a lot of tutorials, all using the file-transfer plugin. Also, on the ionic docs there are no mention about the plugin being deprecated.

Only checking the plugin repository I could see the note about the deprecation: https://github.com/apache/cordova-plugin-file-transfer#deprecated

Thank you for pointing this. I’ll try something different to do my uploads.


#4

Yeah, it’s bad of me to say maybe, but you can’t trust tutorials. The framework is changing a lot. Getting better, but it’s different. Read official documents first, instead of reading tutorials first.


#5

I believe they’re working on adding a depreciation note to the ionic docs as well, as it’s naturally confusing/misleading.


#6

I might be late to this, but is there any other alternative? any tutorials perhaps that can help?