【问题标题】:Failed to install 'cordova-plugin-firebase-authentication': undefined无法安装“cordova-plugin-firebase-authentication”:未定义
【发布时间】:2020-02-28 22:56:58
【问题描述】:

我正在尝试从 ionic 4 构建 iOS。但由于以下错误而卡住了

Using cordova-fetch for cordova-ios@^5.0.0
 Adding ios project...
 Creating Cordova project for the iOS platform:
    Path: platforms/ios
    Package: com.bombaydesigncentre.bloodbuddies
    Name: Blood Buddies
 iOS project created with cordova-ios@5.0.1
 Installing "call-number" for ios
 Installing "cordova-open-native-settings" for ios
 Installing "cordova-plugin-androidx" for ios
 Installing "cordova-plugin-androidx-adapter" for ios
 Installing "cordova-plugin-contacts" for ios
 Installing "cordova-plugin-device" for ios
 Installing "cordova-plugin-firebase" for ios
 Installing "cordova-plugin-firebase-authentication" for ios
 Failed to install 'cordova-plugin-firebase-authentication': undefined CordovaError: Promise rejected with non-error: '/Library/Ruby/Gems/2.3.0/gems/claide-1.0.2/lib/claide/command.rb:439:in `help!\': \u001b[31m[!] You cannot run CocoaPods as root.\u001b[39m (CLAide::Help)\n\n\u001b[4mUsage:\u001b[24m\n\n    $ \u001b[32mpod\u001b[39m \u001b[32mCOMMAND\u001b[39m\n\n      CocoaPods, the Cocoa library package manager.\n\n\u001b[4mCommands:\u001b[24m\n\n    \u001b[32m+ cache\u001b[39m      Manipulate the CocoaPods cache\n    \u001b[32m+ env\u001b[39m        Display pod environment\n    \u001b[32m+ init\u001b[39m       Generate a Podfile for the current directory\n    \u001b[32m+ install\u001b[39m    Install project dependencies according to versions from a\n                 Podfile.lock\n    \u001b[32m+ ipc\u001b[39m        Inter-process communication\n    \u001b[32m+ lib\u001b[39m        Develop pods\n    \u001b[32m+ list\u001b[39m       List pods\n    \u001b[32m+ outdated\u001b[39m   Show outdated project dependencies\n    \u001b[32m+ repo\u001b[39m     Manage spec-repositories\n    \u001b[32m+ setup\u001b[39m      Setup the CocoaPods environment\n    \u001b[32m+ spec\u001b[39m       Manage pod specs\n    \u001b[32m+ update\u001b[39m     Update outdated project dependencies and create new Podfile.lock\n\n\u001b[4mOptions:\u001b[24m\n\n    \u001b[34m--silent\u001b[39m     Show nothing\n    \u001b[34m--version\u001b[39m    Show the version of the tool\n    \u001b[34m--verbose\u001b[39m    Show more debugging information\n    \u001b[34m--no-ansi\u001b[39m    Show output without ANSI codes\n    \u001b[34m--help\u001b[39m       Show help banner of specified command\n\tfrom /Library/Ruby/Gems/2.3.0/gems/cocoapods-1.7.5/lib/cocoapods/command.rb:47:in `run\'\n\tfrom /Library/Ruby/Gems/2.3.0/gems/cocoapods-1.7.5/bin/pod:55:in `<top (required)>\'\n\tfrom /usr/local/bin/pod:22:in `load\'\n\tfrom /usr/local/bin/pod:22:in `<main>\'\n'
    at cli.catch.err (/usr/local/lib/node_modules/cordova/bin/cordova:29:15)
    at process._tickCallback (internal/process/next_tick.js:68:7)
 [ERROR] An error occurred while running subprocess cordova.

安装 cordova-plugin-firebase-authentication

失败

我尝试了多种方法,例如更改权限,更改 /usr/local/lib/node_modules/cordova 的用户,但没有运气。

这里是使用的插件列表:

  • cordova-open-native-settings 1.5.2“原生设置”
  • cordova-plugin-androidx 1.0.2 "cordova-plugin-androidx"
  • cordova-plugin-androidx-adapter 1.1.0 "cordova-plugin-androidx-adapter"
  • cordova-plugin-contacts 3.0.1“联系人”
  • cordova-plugin-device 2.0.3“设备”
  • cordova-plugin-firebase 2.0.5“Google Firebase 插件”
  • cordova-plugin-firebase-authentication 3.0.0 "cordova-plugin-firebase-authentication"
  • cordova-plugin-geolocation 4.0.2“地理位置”
  • cordova-plugin-ionic-keyboard 2.2.0 "cordova-plugin-ionic-keyboard"
  • cordova-plugin-ionic-webview 4.1.2 "cordova-plugin-ionic-webview"
  • cordova-plugin-network-information 2.0.2“网络信息”
  • cordova-plugin-splashscreen 5.0.3“启动画面”
  • cordova-plugin-statusbar 2.4.3“状态栏”
  • cordova-plugin-whitelist 1.3.4“白名单”
  • cordova-support-android-plugin 1.0.1 "cordova-support-android-plugin"
  • cordova-support-google-services 1.3.2“cordova-support-google-services”
  • cordova.plugins.diagnostic 5.0.1“诊断”
  • onesignal-cordova-plugin 2.7.0“OneSignal 推送通知”

【问题讨论】:

  • 这是因为最近的更新 Google Firebase 更新 - 2019 年 6 月 17 日 firebase.google.com/support/release-notes/android#version_1621
  • android 构建工作正常。问题仅出在 iOS 上
  • 不,它在您的错误中明确说明 Failed to install 'cordova-plugin-firebase-authentication': undefined CordovaError
  • 为 ios 安装“cordova-plugin-firebase-authentication”,如错误中所述。有没有解决这个问题。我想改变版本吗

标签: ios firebase cordova ionic-framework ionic4


【解决方案1】:

因此,在进行了几次更改后,我发现问题是由于 npm 包引起的。 我们在 NodeJs 10.17.0 上遇到了这个错误。所以,我们将 NodeJs 降级到 10.14.2

好像 firebase 身份验证插件可能与 NodeJs 10.17.0 冲突

所以,最终的配置是

cordova-plugin-firebase-authentication 3.0.0
NodeJs 10.14.2
npm 6.4.1
cordova cli 9.0.0

【讨论】:

    猜你喜欢
    • 2022-01-17
    • 1970-01-01
    • 2017-11-20
    • 1970-01-01
    • 2018-07-31
    • 1970-01-01
    • 2020-12-06
    • 2019-03-05
    • 1970-01-01
    相关资源
    最近更新 更多