【问题标题】:Firebase createUserWithEmailAndPassword method is undefined in node.js [duplicate]Firebase createUserWithEmailAndPassword 方法在 node.js 中未定义 [重复]
【发布时间】: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


【解决方案1】:

Firebase 3.0.5 中没有针对node.js 的createUserWithEmailAndPassword 方法,请看documentation

猜你喜欢
  • 1970-01-01
  • 2018-03-25
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-03-04
  • 1970-01-01
  • 2016-11-17
相关资源
最近更新 更多