Plugin fails to install on Cordova 9.x
See original GitHub issueOn Cordova 9.x, the following error occurs during the installation of branch-cordova-sdk:
Failed to install 'branch-cordova-sdk': CordovaError: Using "requireCordovaModule" to load non-cordova module "q" is not supported. Instead, add this module to your dependencies and use regular "require" to load it.
at Context.requireCordovaModule (C:\Users\bytenik\Documents\Projects\BallStreet\app\node_modules\cordova-lib\src\hoo
ks\Context.js:57:15)
at Object.install (C:\Users\bytenik\Documents\Projects\BallStreet\app\plugins\branch-cordova-sdk\src\scripts\npm\dow
nloadNpmDependencies.js:18:23)
at run (C:\Users\bytenik\Documents\Projects\BallStreet\app\plugins\branch-cordova-sdk\src\scripts\hooks\beforePlugin
Install.js:11:22)
at runScriptViaModuleLoader (C:\Users\bytenik\Documents\Projects\BallStreet\app\node_modules\cordova-lib\src\hooks\H
ooksRunner.js:181:32)
at runScript (C:\Users\bytenik\Documents\Projects\BallStreet\app\node_modules\cordova-lib\src\hooks\HooksRunner.js:1
57:16)
at C:\Users\bytenik\Documents\Projects\BallStreet\app\node_modules\cordova-lib\src\hooks\HooksRunner.js:125:20
at processTicksAndRejections (internal/process/next_tick.js:81:5)
Failed to restore plugin "branch-cordova-sdk" from config.xml. You might need to try adding it again. Error: Using "requireCordovaModule" to load non-cordova module "q" is not supported. Instead, add this module to your dependencies and use regular "require" to load it.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:13
- Comments:8 (3 by maintainers)
Top Results From Across the Web
cordova-plugin-device
This plugin defines a global device object, which describes the device's ... UUID which is unique and the same for all apps installed...
Read more >Cordova-android v 9.0.0 build failed. Invalid ...
Due to API 29 support, I'm trying to upgrade Cordova-android platform to v9.0.0. But I'm facing a strange error. Error:.
Read more >Cordova SDK Troubleshooting - Visual Studio App Center
One possible cause of this error is when running cordova plugin add cordova-plugin-appcenter-<module> without CocoaPods installed. In this case, ...
Read more >Failing to add cordova plugin from Github - Builds
Adding it to the project Failed to fetch plugin github:apache/cordova-plugin-file-transfer via registry. Probably this is either a connection problem, or plugin ...
Read more >cordova
This tool helps with management of multi-platform Cordova applications as well as Cordova plugin integration. Installation. In your command-line ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I enlarged my fork
innomobile-branch-cordova-sdk@3.1.8-beta.2
that removes requireCordovaModule and changed it with normal require. My fork is also using CocoaPods (see #533 - which this official plugin never integrated).Anyone who wants to test it, take a look at https://www.npmjs.com/package/innomobile-branch-cordova-sdk . The steps:
cordova plugin add innomobile-branch-cordova-sdk
Replace the line with
branch-cordova-sdk
inside config.xml with<plugin name="innomobile-branch-cordova-sdk" spec="^3.1.8-beta.2" />
I am using it on my app and seems working - but if anyone else can check too would be great 😃
This should be resolved in the latest release.