Cordova error: Using "requireCordovaModule" to load non-cordova module "q" is not supported

I have returned to the previous version: 8.1.2.

npm install -g [email protected]

Now, it's working again.

If you want to stay on the latest version of cordova, go to the following instructions:
https://stackoverflow.com/a/58956882/9536897


Simple:

Replace the requireCordovaModule to require :

requireCordovaModule("q") to require("q")


This solution worked for me - https://github.com/xpbrew/cordova-sqlite-storage/issues/856#issuecomment-497298630

For whatever plugin this error is associated with, run:

cordova platform rm ios
cordova platform rm android
cordova plugin rm <package-name>

npm i <package-name>@latest
cordova plugin add <package-name>
cordova platform add ios
cordova platform add android

edit: I recently discovered that running:

cordova platform add ios && cordova platform add android

would not install the most recent versions, would be nice for someone to explain why this is different to running them seperately, but this was my problem.