我已经在CLI中导出了我的用户:
firebase auth:export my_users.json
Run Code Online (Sandbox Code Playgroud)
导出文件中的密码应使用SCRYPT进行哈希处理,因为文档说明:
auth:export命令仅使用scrypt算法导出密码哈希值,该算法由Firebase后端使用.使用其他算法散列密码的帐户记录将使用空的passwordHash和salt字段导出.从文件导入用户记录后,项目可能会使用其他算法对密码进行哈希处理,因为当导入的用户第一次登录时,密码只会被scrypt重新哈希
我的哈希键和salt字段在结果中不为空.另外,我知道我的所有用户都至少登录过一次.
现在,当我尝试导入my_users.json时:
firebase auth:import --hash-algo=SCRYPT --rounds=1 my_users.json
Run Code Online (Sandbox Code Playgroud)
我收到以下错误:
Must provide hash key(base64 encoded) for hash algorithm SCRYPT
Run Code Online (Sandbox Code Playgroud)
但是我应该设置什么--hash-key,因为auth:export命令没有接受任何参数?...
提前致谢
在Cloud 9中安装了firebase-tools.要进行设置,尝试firebase login但无法获得cli的auth.单击提供的身份验证链接后,重定向URL将查找显然无法访问的localhost.
关于cloud9支持的答案是有道理的,但做了所有在那里被告知但仍然无法使其工作的事情.身份验证链接本身已经有localhost重定向到端口,默认情况下端口是9005链接 - 手动将其更改为c9工作区预览URL或端口号从Google返回"redirect url mismatched".
其他人在Cloud 9中尝试过firebase-tools并使其工作?提前致谢!
我是Windows用户并尝试使用npm install -g firebase-tools更新firebase版本 但是当我运行firebase --version时 它显示相同的版本.我也运行npm卸载firebase --save并检查firebase --version它显示相同.我该怎么做才能更新我的firebase版本?
当我运行时firebase emulators:start出现此错误
错误:如果没有在 firebase.json 中指定规则文件,则无法启动存储模拟器
在安装存储模拟器之前,我可以像这样设置 Firestore 规则
{
"firestore": {
"rules": "./functions/firestore.rules"
},
"functions": {
"predeploy": [
"npm --prefix \"$RESOURCE_DIR\" run lint",
"npm --prefix \"$RESOURCE_DIR\" run build"
]
},
"emulators": {
"auth": {
"port": 9099
},
"functions": {
"port": 5001
},
"firestore": {
"port": 8080
},
"storage": {
"port": 9199
},
"ui": {
"enabled": true
}
}
}
Run Code Online (Sandbox Code Playgroud)
我想我必须在这里制定存储规则。但我不知道怎么办。我找不到这方面的文档
firebase firebase-tools firebase-storage firebase-admin firebase-cli
我正在尝试使用该命令初始化一个firebase项目firebase init,但我得到了消息Error: Command requires authentication, please run firebase login.当我运行时firebase login,进程挂起并且不返回提示符:
以前我安装了最新的稳定版node.js和firebase-tools(with npm install -g firebase-tools).我正在使用Windows 8.1 x64机器.
firebase-debug.log文件的内容不报告任何错误或警告:
[debug] ----------------------------------------------------------------------
[debug] Command: C:\Program Files (x86)\nodejs\node.exe C:\Users\ \AppData\Roaming\npm\node_modules\firebase-tools\bin\firebase login
[debug] Platform: win32
[debug] Node Version: v5.1.0
[debug] Time: Mon Nov 23 2015 13:49:06 GMT-0500 (Eastern Standard Time)
[debug] ----------------------------------------------------------------------
[debug]
Run Code Online (Sandbox Code Playgroud)
如何调试login命令?Nomaly它应该打开一个浏览器窗口进行身份验证,但在我的情况下不会发生这种情况.
我试图在本地提供Firebase功能,但是当我运行firebase serve或firebase emulators:start错误消息是:“端口5000未打开,无法启动功能模拟器时”。
我使用的是Windows 10,因此我尝试更改端口号,检查端口是否被防火墙阻止,并在防火墙中为端口5000-5010创建了新规则,但这些方法均不适用于我。
Firebase 功能运行良好我更新到最新的 firebase-tools 现在在运行 firebase serve 时遇到了这个错误问题。
[debug] [2020-05-28T20:37:11.387Z] [runtime-status] [93658] Error in handleMessage: => TypeError: Cannot set property config of #<Object> which has only a getter: TypeError: Cannot set property config of #<Object> which has only a getter
at {....}/node/v10.15.0/lib/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js:455:19
at Generator.next (<anonymous>)
at fulfilled ({....}/node/v10.15.0/lib/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js:5:58)
[warn] ? functions: Cannot set property config of #<Object> which has only a getter {"metadata":{"emulator":{"name":"functions"},"message":"Cannot set property config of #<Object> which has only a getter"}}
[warn] ? Your function was killed because it …Run Code Online (Sandbox Code Playgroud) 每当我在终端使用以下命令(mac os sierra)
firebase init
将显示以下三个选项
?? Database: Deploy Firebase Realtime Database Rules
? Functions: Configure and deploy Cloud Functions
? Hosting: Configure and deploy Firebase Hosting sites
Run Code Online (Sandbox Code Playgroud)
如果我没有选择任何内容并按Enter键
我会得到以下信息
First, let's associate this project directory with a Firebase project.
You can create multiple project aliases by running firebase use --add,
but for now we'll just set up a default project.
i .firebaserc already has a default project, skipping
i Writing configuration info to firebase.json...
i Writing project information to …Run Code Online (Sandbox Code Playgroud) 我想在本地测试我的 firebase 功能。这些函数进行 firestore 查询。
所以我启动模拟器firebase emulators:start并在我的客户端中使用firebase.functions().useFunctionsEmulator('http://localhost:5001').
当我在客户端调用它们时,我的函数运行良好。我可以在 firestore 模拟器中读/写数据。
问题 :
我想直接在我的客户端中读取 firestore 模拟器数据,例如:
firebase.firestore().collection('tests').get().then(tests => {
console.log( tests.docs.map(test=>test.map) )
})
Run Code Online (Sandbox Code Playgroud)
但我找不到如何在我的客户端中设置 firestore 模拟器。
这是我尝试过的:
1) Firestore 设置
firebase.firestore().settings({
host:'http://localhost:8080',
ssl:false
})
Run Code Online (Sandbox Code Playgroud)
结果 :
我@firebase/firestore: Firestore (6.3.5): Could not reach Cloud Firestore backend. Backend didn't respond within 10 seconds.进入我的客户端控制台。
http 请求返回“未找到”
2)在我的 firebaseConfig 中设置模拟器 url
var firebaseConfig = {
// ...
databaseURL: "http://localhost:8080",
// ...
}
firebase.initializeApp(firebaseConfig)
Run Code Online (Sandbox Code Playgroud)
在这种情况下,将请求远程服务器 ( https://firestore.googleapis.com ..)。
所以我想设置这两种情况之一:
1) …
javascript firebase firebase-tools google-cloud-functions google-cloud-firestore
我想在启动时使用我的测试用户帐户预加载 firebase auth 模拟器,就像我对 Firestore 模拟器及其导入/导出选项所做的一样。我尝试在模拟器运行时使用 auth:import 和 auth:export,但它连接到我们实际的开发 firebase 项目,而不是模拟器。无论如何要针对身份验证模拟器运行 auth:import 和 auth:export 吗?
作为参考,我指的是这些命令 ( https://firebase.google.com/docs/cli/auth ) 和这个模拟器 ( https://firebase.google.com/docs/emulator-suite/connect_auth )。