Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cordova - Failed: q is not supported

When I build cordova this message view:

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.

How fix this problem?

PS. I updated npm before this build problem. So it was not problem buildings before update. Sorry my English))

like image 671
Əlibaba Əliyev Avatar asked Mar 22 '19 14:03

Əlibaba Əliyev


4 Answers

The following fixed the issue for me

ionic cordova platform rm ios
ionic cordova plugin remove de.appplant.cordova.plugin.local-notification
ionic cordova plugin rm cordova-sqlite-storage
npm i cordova-sqlite-storage@latest
ionic cordova plugin add cordova-sqlite-storage
ionic cordova platform add [email protected]
ionic build
cordova build ios
like image 136
umunBeing Avatar answered Nov 14 '22 15:11

umunBeing


**In my case the following sequence fixed that issue:

Remove ios platform ionic cordova platform rm ios

Remove android platform ionic cordova platform rm android

Remove sqlite storage plugin ionic cordova plugin rm cordova-sqlite-storage

Install latest sqlite storage npm package npm i cordova-sqlite-storage@latest

Install sqlite storage plugin ionic cordova plugin add cordova-sqlite-storage

Add ios platform ionic cordova platform add ios

Add android platform ionic cordova platform add android

like image 28
Yogesh Kumar Avatar answered Nov 14 '22 13:11

Yogesh Kumar


Just run npm i cordova-sqlite-storage This would upgrade the plugin to the latest version in which this issue is already solved.

like image 1
Akash Chaudhary Avatar answered Nov 14 '22 14:11

Akash Chaudhary


Solved this problem by installing a lower version of cordova. Seems like every version of cordova that is > 8.1.1 breaks a number of plugins.

For instance, the plugin cordova-sqlite-storage failed to install with the following error message:

Failed to install 'cordova-sqlite-storage': 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.

To solve that issue, I simply removed cordova by calling npm uninstall cordova -g and then installed it globally again with npm install -g [email protected]

After that fix, no more errors are getting displayed and cordova-sqlite-storage gets installed smoothly!!

Installing "cordova-sqlite-storage" for android

like image 17
romaneso Avatar answered Nov 14 '22 14:11

romaneso