首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >什么是角14的Firebase身份验证导入?

什么是角14的Firebase身份验证导入?
EN

Stack Overflow用户
提问于 2022-07-09 22:02:27
回答 1查看 463关注 0票数 1

https://github.com/angular/angularfire/blob/HEAD/docs/auth/getting-started.md#5-getting-started-with-firebase-authentication

我正在尝试使用new firebase.authGoogleAuthProvider(),但我不能导入firebase。我安装了:

代码语言:javascript
复制
 "dependencies": {
    "@angular/common": "^14.0.0",
    "@angular/core": "^14.0.0",
    "@angular/fire": "^7.4.1",
    "@angular/forms": "^14.0.0",
    "@angular/platform-browser": "^14.0.0",
    "@angular/platform-browser-dynamic": "^14.0.0",
    "@angular/router": "^14.0.0",
    "@ionic-native/google-plus": "^5.36.0",
    "@ionic-native/sign-in-with-apple": "^5.36.0",
    "@ionic/angular": "^6.1.9",
    "@jest/globals": "^28.1.1",
    "@microsoft/applicationinsights-web": "^2.8.5",
    "angularfire2": "^5.4.2",
    "cordova-plugin-googleplus": "^8.5.2",
    "cordova-plugin-sign-in-with-apple": "^0.1.2",
    "firebase": "^7.9.0",
    "rxjs": "~6.6.0",
    "tslib": "^2.2.0",
    "zone.js": "~0.11.4"
  },

这是node_modules/@firebase的截图

这是其中一个node_modules/firebase

在某个地方,我发现我应该使用这个import,但是正如您所看到的,这个路径并不存在。有什么建议吗?

import firebase from 'firebase/compat/app';

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-07-09 22:14:07

firebase/compat只出现在firebase v9中,我看到您在您的包json中使用"firebase": "^7.9.0",所以npm将在v8之前安装最新版本。

要检查已安装的firebase版本,请参阅node_node/firebase目录中的package.json文件。

要按照指南使用import firebase from 'firebase/compat/app'; -更新package.json文件中的firebase版本并重新运行npm安装。最新版本是9.9.0,所以它将是"firebase": "~9.9.0""firebase": "^9.9.0"

关于https://firebase.google.com/docs/web/modular-upgrade的更多细节

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72924893

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档