Angular – Failed to install ‘cordova-plugin-firebase’: CordovaError: Using “requireCordovaModule” to load non-cordova
angular
cordova
firebase
ionic-framework
xcode
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:
I am developing the app in windows.
You are using cordova 9, and in that version requireCordovaModule was deprecated for non cordova modules and thats why you get the following error.
You need to navigate to the following js file in your environment:
https://github.com/arnesson/cordova-plugin-firebase/blob/master/scripts/ios/helper.js#L33
and change:
var xcode = context.requireCordovaModule("xcode");
into this ( since xcode is an npm package):
var xcode = require("xcode");