【问题标题】:Firebase web 9.0.1 error Package path . is not exportedFirebase web 9.0.1 错误包路径。未导出
【发布时间】:2021-10-31 09:41:58
【问题描述】:

我已经安装了firebase@9.0.1,使用纱线。该软件包似乎工作正常,但在运行yarn install 后出现错误。

Module not found: Error: Package path . is not exported from package /Users/trinity/Projects/hello/node_modules/firebase (see exports field in /Users/trinity/Projects/hello/node_modules/firebase/package.json)

仅供参考,在此附上已安装的库集。

➜  hello git:(main) ✗ yarn list --depth=0 | grep firebase
├─ @firebase/analytics-compat@0.1.1
├─ @firebase/analytics-types@0.7.0
├─ @firebase/analytics@0.7.0
├─ @firebase/app-check-compat@0.1.1
├─ @firebase/app-check-interop-types@0.1.0
├─ @firebase/app-check@0.4.0
├─ @firebase/app-compat@0.1.1
├─ @firebase/app-types@0.7.0
├─ @firebase/app@0.7.0
├─ @firebase/auth-compat@0.1.1
├─ @firebase/auth-interop-types@0.1.6
├─ @firebase/auth-types@0.11.0
├─ @firebase/auth@0.17.1
├─ @firebase/component@0.5.6
├─ @firebase/database-compat@0.1.0
├─ @firebase/database-types@0.9.0
├─ @firebase/database@0.12.0
├─ @firebase/firestore-compat@0.1.1
├─ @firebase/firestore-types@2.5.0
├─ @firebase/firestore@3.0.1
├─ @firebase/functions-compat@0.1.1
├─ @firebase/functions-types@0.5.0
├─ @firebase/functions@0.7.0
├─ @firebase/installations@0.5.0
├─ @firebase/logger@0.2.6
├─ @firebase/messaging-compat@0.1.0
├─ @firebase/messaging-interop-types@0.1.0
├─ @firebase/messaging@0.9.0
├─ @firebase/performance-compat@0.1.0
├─ @firebase/performance-types@0.1.0
├─ @firebase/performance@0.5.0
├─ @firebase/polyfill@0.3.36
├─ @firebase/remote-config-compat@0.1.0
├─ @firebase/remote-config-types@0.2.0
├─ @firebase/remote-config@0.2.0
├─ @firebase/storage-compat@0.1.1
├─ @firebase/storage-types@0.6.0
├─ @firebase/storage@0.8.1
├─ @firebase/util@1.3.0
├─ @firebase/webchannel-wrapper@0.5.1
├─ firebase@9.0.1
➜  hello git:(main) ✗

开发环境是一个电子,我在项目中使用ERB template。 Yarn 安装依赖很好,问题出现在安装后脚本中。请留下任何线索以解决问题。谢谢

【问题讨论】:

  • 使用yarn add firebase 然后yarn install 添加firebase似乎没有问题。如何重现此问题?也许您可以就这个问题提供更多详细信息。
  • @JMGelilio 更新了问题,请检查。
  • 你能解决这个问题吗?可能与我的问题有关:stackoverflow.com/questions/69054603/…
  • 目前没有解决方案:(

标签: node.js reactjs firebase google-cloud-platform electron


【解决方案1】:

试试这个:

import * as firebase from "firebase/app"

在这里找到:https://stackoverflow.com/a/68984595/903000

【讨论】:

  • 在我的情况下,这个解决方案编译正常,但 firebase.auth 无法访问。
猜你喜欢
  • 2021-11-02
  • 2022-09-24
  • 2022-01-25
  • 2022-01-11
  • 2022-09-24
  • 2018-10-12
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多