ERROR] An error occurred while running cordova prepare (exit code 1):

noam aghai picture noam aghai · Aug 8, 2017 · Viewed 12.6k times · Source

[ERROR] An error occurred while running cordova prepare (exit code 1):

    Discovered plugin "cordova-plugin-camera" in config.xml. Adding it to the project
    Installing "cordova-plugin-camera" for android
    Failed to install 'cordova-plugin-camera': CordovaError: Version of installed plugin:
    "[email protected]" does not satisfy dependency plugin requirement "cordova-plugin-compat@^1.1.0". Try
    --force to use installed plugin as dependency.
    at C:\Users\******\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\plugman\install.js:581:33
    at _fulfilled (C:\Users\******\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:787:54)
    at self.promiseDispatch.done (C:\Users\******\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:816:30)
    at Promise.promise.promiseDispatch
    (C:\Users\******\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:749:13)
    at C:\Users\******\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:509:49
    at flush (C:\Users\******\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:108:17)
    at _combinedTickCallback (internal/process/next_tick.js:73:7)
    at process._tickCallback (internal/process/next_tick.js:104:9)
    Failed to restore plugin "cordova-plugin-camera" from config.xml. You might need to try adding it again. Error:
    Version of installed plugin: "[email protected]" does not satisfy dependency plugin requirement
    "cordova-plugin-compat@^1.1.0". Try --force to use installed plugin as dependency.

I really lost in this error, can you explain me what is this error and how to handle this ?

Answer

Swapnil Patwa picture Swapnil Patwa · Aug 8, 2017

Remove and after that install by ionic cordova plugin add cordova-plugin-compat and build again.