Details
-
Bug
-
Status: Closed
-
Critical
-
Resolution: Fixed
-
None
-
None
-
None
-
cordova@8.0.0
cordova-common@2.2.1
cordova-lib@8.0.0
cordova-fetch@1.3.0
npm@5.6.0
node@9.4.0
Description
I'm currently unable to install Microsoft's cordova-plugin-code-push due to some incredibly confusing errors when installing the plugin dependencies.
The plugin lists 3 dependencies in plugin.xml.
Cordova successfully installs the first (code-push) dependency.
Cordova attempts to install the second (cordova-plugin-device) dependency. It appears that the npm install is successful.
At the end of the npm install, cordova-fetch attempts to discover what was just installed. Rather than finding "cordova-plugin-device", it finds "code-push" for a second time.
Then it fails with the following confusing error message:
Failed to install 'cordova-plugin-code-push': Error: Expected plugin to have ID "cordova-plugin-dialogs" but got "code-push".
The full verbose output from cordova prepare is below:
Discovered plugin "cordova-plugin-code-push" in config.xml. Adding it to the project No scripts found for hook "before_plugin_add". Calling plugman.fetch on plugin "cordova-plugin-code-push@^1.11.2" Running command: npm install cordova-plugin-code-push@^1.11.2 --production --no-save Command finished with error code 0: npm install,cordova-plugin-code-push@^1.11.2,--production,--no-save Copying plugin "/PROJECT/node_modules/cordova-plugin-code-push" => "/PROJECT/plugins/cordova-plugin-code-push" Calling plugman.install on plugin "/PROJECT/plugins/cordova-plugin-code-push" for platform "android Installing "cordova-plugin-code-push" for android Running command: /PROJECT/platforms/android/cordova/version Command finished with error code 0: /PROJECT/platforms/android/cordova/version Dependencies detected, iterating through them... Requesting plugin "code-push@2.0.4". Plugin dependency "code-push" not fetched, retrieving then installing. Running command: npm install code-push@2.0.4 --production --no-save Command finished with error code 0: npm install,code-push@2.0.4,--production,--no-save Copying plugin "/PROJECT/node_modules/code-push" => "/PROJECT/plugins/code-push" Installing "code-push" for android Finding scripts for "before_plugin_install" hook from plugin code-push on android platform only. No scripts found for hook "before_plugin_install". Install start for "code-push" on android. Beginning processing of action stack for android project... Action stack processing complete. Install complete for code-push on android. Finding scripts for "after_plugin_install" hook from plugin code-push on android platform only. No scripts found for hook "after_plugin_install". Requesting plugin "cordova-plugin-dialogs@>=1.1.1". Plugin dependency "cordova-plugin-dialogs" not fetched, retrieving then installing. Running command: npm install cordova-plugin-dialogs@>=1.1.1 --production --no-save Command finished with error code 0: npm install,cordova-plugin-dialogs@>=1.1.1,--production,--no-save Copying plugin "/PROJECT/node_modules/code-push" => "/PROJECT/plugins/code-push" Failed to install 'cordova-plugin-code-push': Error: Expected plugin to have ID "cordova-plugin-dialogs" but got "code-push". at checkID (/PROJECT/node_modules/cordova-lib/src/plugman/fetch.js:215:15) at /PROJECT/node_modules/cordova-lib/src/plugman/fetch.js:199:9 at _fulfilled (/PROJECT/node_modules/cordova-lib/node_modules/q/q.js:787:54) at self.promiseDispatch.done (/PROJECT/node_modules/cordova-lib/node_modules/q/q.js:816:30) at Promise.promise.promiseDispatch (/PROJECT/node_modules/cordova-lib/node_modules/q/q.js:749:13) at /PROJECT/node_modules/cordova-lib/node_modules/q/q.js:557:44 at flush (/PROJECT/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-code-push" from config.xml. You might need to try adding it again. Error: Error: Expected plugin to have ID "cordova-plugin-dialogs" but got "code-push".