error "requirecordovamodule" to load non-cordova module "fs" is not supported

5.4k Views Asked by At

I was trying to install the firebasex cordova plugin and it requires 9>=cordova. So I updated to cordova 9 and when trying to add the cordova plugins im getting the below error:

using "requirecordovamodule" to load non-cordova module "fs" is not supported. 
instead, add this module to your dependencies and use regular "require" to load it.

How to solve this?

1

There are 1 best solutions below

2
On

You are maybe using old plugins...

Search for 'requirecordovamodule' in all your code. You might find lines like

var fs = context.requirecordovamodule('fs');

If it is in a plugin, try to update the plugin.

If no updates are available, you can try to replace the line by

var fs = require('fs');