Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to install 'cordova-sqlite-storage': CordovaError: Using "requireCordovaModule" to load non-cordova module "q" is not supported. #856

Closed
ferdiaddawy opened this issue Mar 27, 2019 · 17 comments

Comments

@ferdiaddawy
Copy link

sqlite plugins cannot be installed on Cordova 9, please adjust the plugin.

@macsupport
Copy link

Same here

@swaytz
Copy link

swaytz commented Apr 2, 2019

Is the issue fixed? or should we revert to the older version of Cordova.

@brodycj
Copy link
Contributor

brodycj commented Apr 2, 2019

This plugin version should already be fixed.

@remware
Copy link

remware commented Apr 7, 2019

What is the version containing the fix?

@zoltanradics
Copy link

zoltanradics commented Apr 7, 2019

Can you give a try go to ./plugins/cordova-sqlite-storage/scripts/beforePluginInstall.js and add var Q = require('q') on the top of the file and comment out this line var Q = context.requireCordovaModule('q')? I was able to add the ios platform now.

@brodycj
Copy link
Contributor

brodycj commented Apr 7, 2019

Guys this should be resolved in the latest version (3.2.0). It was also resolved in 3.0.0. Please upgrade to the latest version as I do not have so much time to support questions on older plugin versions.

@brodycj brodycj closed this as completed Apr 7, 2019
@DavidWiesner
Copy link

I'm not shure but I got the same issue when removing the old and then add the new plugin version. I solved this by removing all platforms. Then removing the plugins folder and add the platforms again. Be aware other plugins may also can cause this issue.

@brodycj
Copy link
Contributor

brodycj commented Apr 11, 2019

Thanks @DavidWiesner, reopening for now. I wonder if this should be raised on Cordova itself?

@brodycj brodycj reopened this Apr 11, 2019
@winningtechnologies
Copy link

Tried @DavidWiesner 's solution and it didn't work while building on Ionic Pro. Any suggestions?

@brodycj
Copy link
Contributor

brodycj commented Apr 14, 2019

Closing as invalid. This plugin is already fixed. Please do the following:

  • completely remove plugins and platforms from your project
  • add plugins and platforms to .gitignore (plugins and platforms should not be committed)
  • update cordova-sqlite-storage to the most recent version (I do not support older versions)

In case anyone continues to see this kind of an issue with cordova-sqlite-storage then please make an example project according to https://stackoverflow.com/help/mcve.

@setu1421
Copy link

I am getting the same error. What's the solution?
image

@light8822
Copy link

Hello I'm having the same issue how I fix it?

@mellowpixel
Copy link

mellowpixel commented May 30, 2019

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

Alternatively run these commands as one line:
ionic cordova platform rm ios; ionic cordova platform rm android; ionic cordova plugin rm cordova-sqlite-storage; npm i cordova-sqlite-storage@latest && ionic cordova plugin add cordova-sqlite-storage; ionic cordova platform add ios; ionic cordova platform add android

@Greko2017
Copy link

Can you give a try go to ./plugins/cordova-sqlite-storage/scripts/beforePluginInstall.js and add var Q = require('q') on the top of the file and comment out this line var Q = context.requireCordovaModule('q')? For me now i was able to add the ios platform now.

It wroks for me thanks

@jiangmouren
Copy link

Can you give a try go to ./plugins/cordova-sqlite-storage/scripts/beforePluginInstall.js and add var Q = require('q') on the top of the file and comment out this line var Q = context.requireCordovaModule('q')? I was able to add the ios platform now.

Works for Android as well. Thx!

@brodycj
Copy link
Contributor

brodycj commented Jan 22, 2020

Issues with a "q" module indicate use of an old version of this plugin in plugins or platforms directories. Old versions of this plugin are not supported and are known to be missing security and data integrity updates. Please check the following items very carefully:

  • no plugins configured in config.xml (Cordova should migrate plugins from config.xml but I have seen issues with this in the past)
  • remove outdated version of this plugin from package.json
  • ensure that there are no duplicate SQLite plugin versions in package.json (use of multiple SQLite plugins should be considered undefined behavior and may be different on iOS, Android, and other platforms)
  • use cordova plugin add command to add most recent version of this plugin, if it is not already configured

Then it should be possible to add and rebuild on Android, iOS, macOS ("osx"), and Windows.

@vrdriver
Copy link

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

Alternatively run these commands as one line:
ionic cordova platform rm ios; ionic cordova platform rm android; ionic cordova plugin rm cordova-sqlite-storage; npm i cordova-sqlite-storage@latest && ionic cordova plugin add cordova-sqlite-storage; ionic cordova platform add ios; ionic cordova platform add android

And also in conjunction with this too:
npm install -g cordova@8.1.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests