我在启动模拟器后遇到了这个错误,我在终端上的图像和错误下添加了我的代码。这是我在模拟器上的 App.js 文件 错误图像
错误:错误:尝试
firebase
从文件解析module时,成功找到/Users/capcapbakkal/Desktop/RNKurs/identifyVerification/index.js
了包。/Users/capcapbakkal/Desktop/RNKurs/identifyVerification/node_modules/firebase/package.json
但是,这个包本身指定了一个main
无法解析的module字段(/Users/capcapbakkal/Desktop/RNKurs/identifyVerification/node_modules/firebase/index
。事实上,这些文件都不存在:
import firebase from 'firebase/compat/app';
import 'firebase/compat/auth';
import 'firebase/compat/firestore';
和
componentDidMount() {
const firebaseApp = initializeApp({
apiKey: "AIzaSyCpM2dwcUvJqVaKz856hz",
authDomain: "authentication-b4",
projectId: "authen",
storageBucket: "authenticat",
messagingSenderId: "7532",
appId: "1:753222",
measurementId: "G-"
});// I changed this, it isn't wrong
}