无法安装"cordova-plugin-firebase":CordovaError:使用"requireCordovaModule";加载非科尔多瓦 [英] Failed to install 'cordova-plugin-firebase': CordovaError: Using "requireCordovaModule" to load non-cordova

查看:52
本文介绍了无法安装"cordova-plugin-firebase":CordovaError:使用"requireCordovaModule";加载非科尔多瓦的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用我的应用程序(离子V-4)中的 firebase 执行电话身份验证.创建该应用程序后,我刚刚添加了 android/ios 平台,使用以下命令:

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

然后尝试像这样安装firebase插件:

Then tried to install firebase plugin like this:

ionic cordova plugin add cordova-plugin-firebase

它抛出此错误:

我正在 windows 中开发该应用程序.

I am developing the app in windows.

推荐答案

您正在使用cordova 9,并且在该版本中

You are using cordova 9, and in that version requireCordovaModule was deprecated for non cordova modules and thats why you get the following error.

您需要在您的环境中导航到以下js文件:

You need to navigate to the following js file in your environment:

https://github.com.com/arnesson/cordova-plugin-firebase/blob/master/scripts/ios/helper.js#L33

并更改:

var xcode = context.requireCordovaModule("xcode");

为此(因为 xcode 是npm软件包):

into this ( since xcode is an npm package):

var xcode = require("xcode");

这篇关于无法安装"cordova-plugin-firebase":CordovaError:使用"requireCordovaModule";加载非科尔多瓦的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆