Ionic cordova prepare ios - not working (ionic4)

Hi all,

I am facing this error while trying to run ionic cordova prepare ios and run ios.

Error msg is as shown below.

Using "requireCordovaModule" to load non-cordova module "glob" is not supported. Instead, add this module to your dependencies and use regular "require" to load it.
CordovaError: Using "requireCordovaModule" to load non-cordova module "glob" is not supported. Instead, add this module to your dependencies and use regular "require" to load it.
    at Context.requireCordovaModule (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/Context.js:57:15)
    at exports.default (/Users/joabchua/Documents/dev/ionic/passguard-v3/plugins/cordova-plugin-add-swift-support/add-swift-support.js:12755:22)
    at runScriptViaModuleLoader (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:181:32)
    at runScript (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:157:16)
    at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:125:20
    at processTicksAndRejections (internal/process/next_tick.js:81:5)
[ERROR] An error occurred while running subprocess cordova.

Anyone face this issue before? Appreciate if there is any help.

1 Like

Yes! You are running the brand new Cordova v9 :partying_face: which deprecated the requireCordovaModule (https://github.com/apache/cordova-lib/pull/707). Probably you are using a plugin which uses the deprecated method. Find it, report it to the author and/or contribute a PR to fix it. Otherwise you might want to downgrade to Cordova v8 until all your used plugins are ready for Cordova v9.

Okie. I see. I actually thought the author would fix all the modules using requiredCordovaModule first before deprecating it. Thanks a lot for your reply.

The “core” team of Apache Cordova is not the author of all the plugins out there :wink:

HAHAHA. That’s true. :stuck_out_tongue::+1:

Can I downgrade to Cordova v8 in Package Function from AppFlow?