小编Jos*_*Gao的帖子

已成功找到“Firebase”包。然而,这个包本身指定了一个无法解析的“main”模块字段

我正在尝试读取和写入 firestore、使用 firebase 的身份验证以及在 expo 管理的反应本机应用程序中使用 firebase 的存储。

完整错误:

While trying to resolve module `firebase` from file `C:\Users\joshu\Desktop\VSProjects\VolleyballConnect\firebase.js`, the package `C:\Users\joshu\Desktop\VSProjects\VolleyballConnect\node_modules\firebase\package.json` was successfully found. However, this package itself specifies a `main` module field that could not be resolved (`C:\Users\joshu\Desktop\VSProjects\VolleyballConnect\node_modules\firebase\index`. Indeed, none of these files exist:

  * C:\Users\joshu\Desktop\VSProjects\VolleyballConnect\node_modules\firebase\index(.native|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx|.android.js|.native.js|.js|.android.jsx|.native.jsx|.jsx|.android.json|.native.json|.json)
  * C:\Users\joshu\Desktop\VSProjects\VolleyballConnect\node_modules\firebase\index\index(.native|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx|.android.js|.native.js|.js|.android.jsx|.native.jsx|.jsx|.android.json|.native.json|.json)
Run Code Online (Sandbox Code Playgroud)

我的 firebase 配置文件:

import firebase from "firebase";
import { initializeApp } from "firebase/app";
import "firebase/firestore";
import "firebase/auth";
import "firebase/storage";

// I'm using the example key here, I have the correct config …
Run Code Online (Sandbox Code Playgroud)

javascript node.js firebase react-native expo

15
推荐指数
3
解决办法
2万
查看次数

标签 统计

expo ×1

firebase ×1

javascript ×1

node.js ×1

react-native ×1