opentok / cordova-plugin-opentok

Cordova Plugin for OpenTok - add webrtc video to your iOS or Android App
MIT License
30 stars 80 forks source link

Error at Ionic (iOS) plugin installation: Using "requireCordovaModule" not supported #180

Closed lqrz closed 3 years ago

lqrz commented 4 years ago

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'),

My ionic info:


cli packages: (/Users/.../.nvm/versions/node/v10.15.1/lib/node_modules)

    @ionic/cli-utils  : 1.19.3
    ionic (Ionic CLI) : 3.20.1

global packages:

    cordova (Cordova CLI) : 9.0.0 (cordova-lib@9.0.1) 

local packages:

    @ionic/app-scripts : 3.2.1
    Cordova Platforms  : android 8.0.0 ios 5.0.1
    Ionic Framework    : ionic-angular 3.9.2

System:

    Android SDK Tools : 26.1.1
    ios-deploy        : 1.9.4 
    ios-sim           : 8.0.2 
    Node              : v10.15.1
    npm               : 6.4.1 
    OS                : macOS
    Xcode             : Xcode 11.3 Build version 11C29 

Environment Variables:

    ANDROID_HOME : /Users/.../Library/Android/sdk/

Misc:

    backend : pro
simmunoz commented 4 years ago

Alguna novedad?

Jhonsensf commented 4 years ago

I'm having the same issue. Is there any news?

michaeljolley commented 3 years ago

This should be resolved by https://github.com/opentok/cordova-plugin-opentok/pull/199