【发布时间】:2016-10-27 04:11:45
【问题描述】:
启动有问题..
我初始化了我的 firebase 应用。但是 auth() 不起作用
var auth = firebase.auth();
console.log(auth.createUserWithEmailAndPassword)
createUserWithEmailAndPassword 返回未定义。
它也给出了函数错误
var email = "mail@mail.com"
var password = 123
var auth = firebase.auth();
auth.createUserWithEmailAndPassword(email, password).then(function(result) {
console.log(result)
}).catch(function(error) {
console.log(error)
});
错误:
TypeError: auth.createUserWithEmailAndPassword 不是函数
有什么问题?
【问题讨论】:
-
您是否正在使用
firebase.initializeApp(config);初始化您的应用程序? -
是的,我使用的是 initializeApp。 firebase.database 工作正常,但 firebase.auth 不工作
-
你在 package.json 中的版本是什么? Firebase 几周前发生了重大变化。也许您需要更新到新的 3.x 版本或回到 2.x
-
@libik 我使用的是 3.0.5 版
-
firebaser here 3.0 版的 Firebase SDK for Node.js 中没有创建用户的功能。我们正在努力。见stackoverflow.com/questions/37504466/…
标签: node.js firebase firebase-authentication