Error handling 新Firebase初始化失败

Error handling 新Firebase初始化失败,error-handling,firebase,typeerror,Error Handling,Firebase,Typeerror,想试试新的火箭筒。但是我不能让它工作 app-88ac8456cb.js:14207 Uncaught TypeError: firebase.intializeApp is not a function const config = { apiKey: "....", authDomain: ".....firebaseapp.com", databaseURL: "https://.....firebaseio.com", storageBucket: ".

想试试新的火箭筒。但是我不能让它工作

app-88ac8456cb.js:14207 Uncaught TypeError: firebase.intializeApp is not a function
const config = {
    apiKey: "....",
    authDomain: ".....firebaseapp.com",
    databaseURL: "https://.....firebaseio.com",
    storageBucket: ".....appspot.com",
};

let firebase = require('firebase');

let fireapp = firebase.intializeApp(config);
我使用的是ES6导入,但是即使我像在文档中一样使用commonjs,它也不起作用

app-88ac8456cb.js:14207 Uncaught TypeError: firebase.intializeApp is not a function
const config = {
    apiKey: "....",
    authDomain: ".....firebaseapp.com",
    databaseURL: "https://.....firebaseio.com",
    storageBucket: ".....appspot.com",
};

let firebase = require('firebase');

let fireapp = firebase.intializeApp(config);
已安装:“firebase”:“^3.0.1”

节点:6.2.0


将gulp与browserify一起使用是一种拼写错误。您需要
初始化app


如果你从某个地方剪贴出来,让我知道,我们可以试着把它修好

initializeApp
是一个打字错误。您需要
初始化app

如果你从某个地方剪贴出来,让我知道,我们可以试着把它修好

这对我很有用:

import 'firebase';

const config = {
    apiKey: "....",
    authDomain: ".....firebaseapp.com",
    databaseURL: "https://.....firebaseio.com",
    storageBucket: ".....appspot.com",
};

firebase.initializeApp(config);
firebase.database().ref(...)
//or
let fb = firebase.initializeApp(config);
fb.database().ref(...)
这对我很有用:

import 'firebase';

const config = {
    apiKey: "....",
    authDomain: ".....firebaseapp.com",
    databaseURL: "https://.....firebaseio.com",
    storageBucket: ".....appspot.com",
};

firebase.initializeApp(config);
firebase.database().ref(...)
//or
let fb = firebase.initializeApp(config);
fb.database().ref(...)

谢谢是的,输入错误来自npm软件包,谢谢!是的,输入错误来自npm软件包