When installing the plugin in Ionic3, via running ionic cordova plugin add cordova-plugin-opentok I get the following error for iOS:
CordovaError: Using "requireCordovaModule" to load non-cordova module "q" is not supported.
Here the full log:
Installing "cordova-plugin-opentok" for ios
Failed to install 'cordova-plugin-opentok': 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 (/Users/lqrz/Documents/lqrz/doctors/mobileapp/node_modules/cordova-lib/src/hooks/Context.js:57:15)
at module.exports (/Users/lqrz/Documents/lqrz/doctors/mobileapp/plugins/cordova-plugin-opentok/scripts/downloadiOSSDK.js:7:21)
at runScriptViaModuleLoader (/Users/lqrz/Documents/lqrz/doctors/mobileapp/node_modules/cordova-lib/src/hooks/HooksRunner.js:181:32)
at runScript (/Users/lqrz/Documents/lqrz/doctors/mobileapp/node_modules/cordova-lib/src/hooks/HooksRunner.js:157:16)
at /Users/lqrz/Documents/lqrz/doctors/mobileapp/node_modules/cordova-lib/src/hooks/HooksRunner.js:125:20
at process._tickCallback (internal/process/next_tick.js:68:7)
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.
[ERROR] An error occurred while running cordova plugin add cordova-plugin-opentok --save (exit code 1).
I fixed it by manually editing the file plugins/cordova-plugin-opentok/scripts/downloadiOSSDK.js but this shouldn't be the way to go about it:
// Q = context.requireCordovaModule('q'), <---- line #7
Q = require('q'),
When installing the plugin in Ionic3, via running
ionic cordova plugin add cordova-plugin-opentok
I get the following error for iOS:Here the full log:
I fixed it by manually editing the file
plugins/cordova-plugin-opentok/scripts/downloadiOSSDK.js
but this shouldn't be the way to go about it:My
ionic info
: