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

Running with gitlab-runner 11.3.1 (0aa5179e)
on Ionic Package Android Runner f537d27d
Using Kubernetes namespace: ionic-runners
Using Kubernetes executor with image 319312831725.dkr.ecr.us-west-2.amazonaws.com/ionic-runners/package-android
Waiting for pod ionic-runners/runner-f537d27d-project-0-concurrent-0r29vt to be running, status is Pending
Running on runner-f537d27d-project-0-concurrent-0r29vt via gitlab-runner-55f5c4f79c-kj25x…
Cloning repository…
Cloning into ‘/builds/eBizSolutionsLLC/Mydriver’…
Checking out f35e5cfb as master…
Updating/initializing submodules…
run "fetch-updates" run “build-android”
[05:28:25]: ------------------------------
[05:28:25]: — Step: default_platform —
[05:28:25]: ------------------------------
[05:28:25]: Driving the lane ‘android package_build’ :rocket:
[05:28:25]: ---------------------------
[05:28:25]: — Step: build_summary —
[05:28:25]: ---------------------------

±--------------------±--------------------------+
| Build Summary |
±--------------------±--------------------------+
| Job ID | 6717324 |
| Node.js version | v10.17.0 |
| Cordova CLI version | 9.0.3 (cordova-lib@9.0.2) |
| npm version | 6.11.3 |
±--------------------±--------------------------+

05:28:27: — Step: add_git_credentials —
05:28:27: ---------------------------------
05:28:27: Writing git-credentials files
05:28:27: git-credentials successfully added to project
05:28:27: --------------------------------
05:28:27: — Step: detect_native_type —
05:28:27: --------------------------------
05:28:27: Checking if cordova or capacitor project
05:28:27: Cordova project detected
05:28:27: -------------------------
05:28:27: — Step: get_web_dir —
05:28:27: -------------------------
05:28:27: webDir is www
05:28:27: -------------------------------
05:28:27: — Step: modify_config_xml —
05:28:27: -------------------------------
05:28:27: No custom native config detected.
05:28:27: ---------------------------
05:28:27: — Step: build_pro_app —
05:28:27: ---------------------------
05:28:27: Installing Dependencies
05:28:27: npm install --quiet --no-optional [05:28:27]: ▸ npm WARN lifecycle MyDriver@0.0.1~preinstall: cannot run in wd MyDriver@0.0.1 ./cordovaOverride.sh (wd=/builds/eBizSolutionsLLC/Mydriver) [05:28:31]: ▸ audited 7629 packages in 4.275s [05:28:31]: ▸ found 1 low severity vulnerability [05:28:31]: ▸ run `npm audit fix` to fix them, or `npm audit` for details [05:28:31]: Generating app manifest... [05:28:31]: ionic deploy manifest
[05:28:32]: ▸ [OK] Appflow Deploy manifest written to ./www/pro-manifest.json!
[05:28:32]: ----------------------------------
[05:28:32]: — Step: add_cordova_to_index —
[05:28:32]: ----------------------------------
[05:28:32]: codova.js already present in index.html: skipping
[05:28:32]: ---------------------------------
[05:28:32]: — Step: download_credential —
[05:28:32]: ---------------------------------
[05:28:32]: No build credential specified
[05:28:32]: -----------------------------------
[05:28:32]: — Step: build_android_cordova —
[05:28:32]: -----------------------------------
[05:28:32]: Adding Android platform…
[05:28:32]: $ cordova platform add android --no-fetch
[05:28:33]: ▸ You have been opted out of telemetry. To change this, run: cordova telemetry on.
[05:28:33]: ▸ Using cordova-fetch for cordova-android@^8.0.0
[05:28:39]: ▸ Adding android project…
[05:28:39]: ▸ Creating Cordova project for the Android platform:
[05:28:39]: ▸ Path: platforms/android
[05:28:39]: ▸ Package: io.ionic.starter
[05:28:39]: ▸ Name: MyDriver
[05:28:39]: ▸ Activity: MainActivity
[05:28:39]: ▸ Android target: android-28
[05:28:39]: ▸ Subproject Path: CordovaLib
[05:28:39]: ▸ Subproject Path: app
[05:28:39]: ▸ Android project created with cordova-android@8.1.0
[05:28:39]: ▸ Installing “cordova-annotated-plugin-android” for android
[05:28:39]: ▸ Subproject Path: CordovaLib
[05:28:39]: ▸ Subproject Path: app
[05:28:39]: ▸ Installing “cordova-play-services-version-adapter” for android
[05:28:39]: ▸ Installing “cordova-plugin-analytics” for android
[05:28:39]: ▸ Plugin dependency “cordova-play-services-version-adapter@1.0.2” already fetched, using that version.
[05:28:39]: ▸ Dependent plugin “cordova-play-services-version-adapter” already installed on android.
[05:28:39]: ▸ Plugin dependency “cordova-annotated-plugin-android@1.0.4” already fetched, using that version.
[05:28:39]: ▸ Dependent plugin “cordova-annotated-plugin-android” already installed on android.
[05:28:39]: ▸ Subproject Path: CordovaLib
[05:28:39]: ▸ Subproject Path: app
[05:28:39]: ▸ Installing “cordova-plugin-camera” for android
[05:28:39]: ▸ Subproject Path: CordovaLib
[05:28:39]: ▸ Subproject Path: app
[05:28:39]: ▸ Installing “cordova-plugin-console” for android
[05:28:40]: ▸ Installing “cordova-plugin-datepicker” for android
[05:28:40]: ▸ Installing “cordova-plugin-device” for android
[05:28:40]: ▸ Installing “cordova-plugin-ionic-keyboard” for android
[05:28:40]: ▸ Installing “cordova-plugin-splashscreen” for android
[05:28:40]: ▸ Installing “cordova-plugin-statusbar” for android
[05:28:40]: ▸ Installing “cordova-plugin-whitelist” for android
[05:28:40]: ▸ Installing “cordova-support-google-services” for android
[05:28:40]: ▸ Subproject Path: CordovaLib
[05:28:40]: ▸ Subproject Path: app
[05:28:40]: ▸ Installing “ionic-plugin-keyboard” for android
[05:28:41]: ▸ 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.
±---------------------------±----------------------+
| Lane Context |
±---------------------------±----------------------+
| DEFAULT_PLATFORM | ios |
| PLATFORM_NAME | android |
| LANE_NAME | android package_build |
| PROJECT_WEB_DIR | www |
| DOWNLOAD_CREDENTIAL_EXISTS | false |
±---------------------------±----------------------+
[05:28:41]: Shell command exited with exit status 1 instead of 0.

You have been opted out of telemetry. To change this, run: cordova telemetry on.
Using cordova-fetch for cordova-android@^8.0.0
Adding android project…
Creating Cordova project for the Android platform:
Path: platforms/android
Package: io.ionic.starter
Name: MyDriver
Activity: MainActivity
Android target: android-28
Subproject Path: CordovaLib
Subproject Path: app
Android project created with cordova-android@8.1.0
Installing “cordova-annotated-plugin-android” for android
Subproject Path: CordovaLib
Subproject Path: app
Installing “cordova-play-services-version-adapter” for android
Installing “cordova-plugin-analytics” for android
Plugin dependency “cordova-play-services-version-adapter@1.0.2” already fetched, using that version.
Dependent plugin “cordova-play-services-version-adapter” already installed on android.
Plugin dependency “cordova-annotated-plugin-android@1.0.4” already fetched, using that version.
Dependent plugin “cordova-annotated-plugin-android” already installed on android.
Subproject Path: CordovaLib
Subproject Path: app
Installing “cordova-plugin-camera” for android
Subproject Path: CordovaLib
Subproject Path: app
Installing “cordova-plugin-console” for android
Installing “cordova-plugin-datepicker” for android
Installing “cordova-plugin-device” for android
Installing “cordova-plugin-ionic-keyboard” for android
Installing “cordova-plugin-splashscreen” for android
Installing “cordova-plugin-statusbar” for android
Installing “cordova-plugin-whitelist” for android
Installing “cordova-support-google-services” for android
Subproject Path: CordovaLib
Subproject Path: app
Installing “ionic-plugin-keyboard” for android
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.

±-----±----------------------±------------+
| fastlane summary |
±-----±----------------------±------------+
| Step | Action | Time (in s) |
±-----±----------------------±------------+
| 1 | default_platform | 0 |
| 2 | build_summary | 1 |
| 3 | add_git_credentials | 0 |
| 4 | detect_native_type | 0 |
| 5 | get_web_dir | 0 |
| 6 | modify_config_xml | 0 |
| 7 | build_pro_app | 5 |
| 8 | add_cordova_to_index | 0 |
| 9 | download_credential | 0 |
| :boom: | build_android_cordova | 8 |
±-----±----------------------±------------+

[05:28:41]: fastlane finished with errors

Looking for related GitHub issues on fastlane/fastlane…

/usr/local/bundle/gems/fastlane-2.135.2/fastlane_core/lib/fastlane_core/ui/interface.rb:153:in `shell_error!’: [!] Shell command exited with exit status 1 instead of 0. (FastlaneCore::Interface::FastlaneShellError)

You have been opted out of telemetry. To change this, run: cordova telemetry on.
Using cordova-fetch for cordova-android@^8.0.0
Adding android project…
Creating Cordova project for the Android platform:
Path: platforms/android
Package: io.ionic.starter
Name: MyDriver
Activity: MainActivity
Android target: android-28
Subproject Path: CordovaLib
Subproject Path: app
Android project created with cordova-android@8.1.0
Installing “cordova-annotated-plugin-android” for android
Subproject Path: CordovaLib
Subproject Path: app
Installing “cordova-play-services-version-adapter” for android
Installing “cordova-plugin-analytics” for android
Plugin dependency “cordova-play-services-version-adapter@1.0.2” already fetched, using that version.
Dependent plugin “cordova-play-services-version-adapter” already installed on android.
Plugin dependency “cordova-annotated-plugin-android@1.0.4” already fetched, using that version.
Dependent plugin “cordova-annotated-plugin-android” already installed on android.
Subproject Path: CordovaLib
Subproject Path: app
Installing “cordova-plugin-camera” for android
Subproject Path: CordovaLib
Subproject Path: app
Installing “cordova-plugin-console” for android
Installing “cordova-plugin-datepicker” for android
Installing “cordova-plugin-device” for android
Installing “cordova-plugin-ionic-keyboard” for android
Installing “cordova-plugin-splashscreen” for android
Installing “cordova-plugin-statusbar” for android
Installing “cordova-plugin-whitelist” for android
Installing “cordova-support-google-services” for android
Subproject Path: CordovaLib
Subproject Path: app
Installing “ionic-plugin-keyboard” for android
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.

from /usr/local/bundle/gems/fastlane-2.135.2/fastlane_core/lib/fastlane_core/ui/ui.rb:17:in `method_missing'
from /usr/local/bundle/gems/fastlane-2.135.2/fastlane/lib/fastlane/helper/sh_helper.rb:80:in `sh_control_output'
from /builds/eBizSolutionsLLC/Mydriver/fastlane/actions/safe_sh.rb:27:in `run'
from /builds/eBizSolutionsLLC/Mydriver/fastlane/actions/build_android_cordova.rb:6:in `run'
from /usr/local/bundle/gems/fastlane-2.135.2/fastlane/lib/fastlane/runner.rb:256:in `block (2 levels) in execute_action'
from /usr/local/bundle/gems/fastlane-2.135.2/fastlane/lib/fastlane/actions/actions_helper.rb:50:in `execute_action'
from /usr/local/bundle/gems/fastlane-2.135.2/fastlane/lib/fastlane/runner.rb:235:in `block in execute_action'
from /usr/local/bundle/gems/fastlane-2.135.2/fastlane/lib/fastlane/runner.rb:227:in `chdir'
from /usr/local/bundle/gems/fastlane-2.135.2/fastlane/lib/fastlane/runner.rb:227:in `execute_action'
from /usr/local/bundle/gems/fastlane-2.135.2/fastlane/lib/fastlane/runner.rb:157:in `trigger_action_by_name'
from /usr/local/bundle/gems/fastlane-2.135.2/fastlane/lib/fastlane/fast_file.rb:159:in `method_missing'
from Fastfile:133:in `block (2 levels) in parsing_binding'
from /usr/local/bundle/gems/fastlane-2.135.2/fastlane/lib/fastlane/lane.rb:33:in `call'
from /usr/local/bundle/gems/fastlane-2.135.2/fastlane/lib/fastlane/runner.rb:49:in `block in execute'
from /usr/local/bundle/gems/fastlane-2.135.2/fastlane/lib/fastlane/runner.rb:45:in `chdir'
from /usr/local/bundle/gems/fastlane-2.135.2/fastlane/lib/fastlane/runner.rb:45:in `execute'
from /usr/local/bundle/gems/fastlane-2.135.2/fastlane/lib/fastlane/lane_manager.rb:56:in `cruise_lane'
from /usr/local/bundle/gems/fastlane-2.135.2/fastlane/lib/fastlane/command_line_handler.rb:36:in `handle'
from /usr/local/bundle/gems/fastlane-2.135.2/fastlane/lib/fastlane/commands_generator.rb:108:in `block (2 levels) in run'
from /usr/local/bundle/gems/commander-fastlane-4.4.6/lib/commander/command.rb:178:in `call'
from /usr/local/bundle/gems/commander-fastlane-4.4.6/lib/commander/command.rb:153:in `run'
from /usr/local/bundle/gems/commander-fastlane-4.4.6/lib/commander/runner.rb:476:in `run_active_command'
from /usr/local/bundle/gems/fastlane-2.135.2/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:76:in `run!'
from /usr/local/bundle/gems/commander-fastlane-4.4.6/lib/commander/delegates.rb:15:in `run!'
from /usr/local/bundle/gems/fastlane-2.135.2/fastlane/lib/fastlane/commands_generator.rb:349:in `run'
from /usr/local/bundle/gems/fastlane-2.135.2/fastlane/lib/fastlane/commands_generator.rb:41:in `start'
from /usr/local/bundle/gems/fastlane-2.135.2/fastlane/lib/fastlane/cli_tools_distributor.rb:119:in `take_off'
from /usr/local/bundle/gems/fastlane-2.135.2/bin/fastlane:23:in `'
from /usr/local/bundle/bin/fastlane:23:in `load'
from /usr/local/bundle/bin/fastlane:23:in `


Running after script…
$ run “clean-up”
ERROR: Job failed: command terminated with exit code 1

Hello @sschaber,

Downgrade you cordova version to 8.1.2 . May be this will solve your issue.
npm install -g cordova@8.1.2