Failed to install 'cordova-plugin-firebase': CordovaError: Using "requireCordovaModule" to load non-cordova

Viewed 8040

I am trying to perform phone authentication using firebase in my app(ionic V-4).After creating the app, I just added the android/ios platforms using the below commands:

 ionic cordova platform add android
 ionic cordova platform add ios

Then tried to install firebase plugin like this:

ionic cordova plugin add cordova-plugin-firebase

It is throwing this error:

enter image description here

I am developing the app in windows.

4 Answers

Actually, your are working on Windows and you added an iOS platform. This is not working.

Remove the iOS platform :

ionic cordova platform rm ios

Then try to install firebase by doing the command below :

ionic cordova plugin add cordova-plugin-firebase
npm install @ionic-native/firebase

Good luck !

Remove iOS platform, it requires a MacOS environment.

ionic cordova platform rm ios

Because when you add plugin it try to install for iOS as well and you are trying it in window pc and xcode not installed on windows.

If you remove ios plaform and try for only android then it will work.

Related