启动模拟器后出现此错误,我在图像下添加代码并在终端上出错。这是我的 App.js 文件 在模拟器上的错误图像
错误:错误:尝试
firebase从文件解析模块时,已成功找到/Users/capcapbakkal/Desktop/RNKurs/identifyVerification/index.js包。/Users/capcapbakkal/Desktop/RNKurs/identifyVerification/node_modules/firebase/package.json然而,这个包本身指定了一个main无法解析的模块字段(/Users/capcapbakkal/Desktop/RNKurs/identifyVerification/node_modules/firebase/index。事实上,这些文件都不存在:
import firebase from 'firebase/compat/app';
import 'firebase/compat/auth';
import 'firebase/compat/firestore';
Run Code Online (Sandbox Code Playgroud)
和
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
}
Run Code Online (Sandbox Code Playgroud) node-modules firebase reactjs react-native firebase-authentication