这是我的代码:
import * as firebase from 'firebase/app';
import 'firebase/auth';
import 'firebase/firestore';
// For Firebase JS SDK v7.20.0 and later, measurementId is optional
const firebaseConfig = {
apiKey: "AIzaSyCtaFhg2rHV7ZuPKFIMaisRsiNUhwSzez8",
authDomain: "twitter-c8bcc.firebaseapp.com",
projectId: "twitter-c8bcc",
storageBucket: "twitter-c8bcc.appspot.com",
messagingSenderId: "951402712179",
appId: "1:951402712179:web:9fe473631359f6f3656e06",
measurementId: "G-7QKS23B79V"
};
const firebaseApp = firebase.initializeApp(firebaseConfig);
const db = firebaseApp.firestore();
export default db;
当我安装npm install firebase/firestore时,它显示了这个错误:
1条答案
按热度按时间g52tjvyc1#
npm
或尝试使用npm install -g npm@latest
进行更新。npm cache clean -f
并删除node_modules
,然后再次运行npm install
。PATH
是否正确,cd
是否为package.json
,并运行npm
start。yarn