Fez*_*sta 7 firebase google-cloud-functions
我正在尝试运行firebase emulators:starts使用 Cloud Functions 的项目。
它在端口 5001 启动本地服务器,如果我在 Chrome 中打开它,我会收到响应{ "status": "alive" },但 30 秒后它会因“超时”而自行关闭。
\xe2\x9c\x94 functions: Emulator started at http://localhost:5001\ni Shutting down emulators.\ni Stopping functions emulator\n\nError: TIMEOUT: Port 5001 was not active within 30000ms\nRun Code Online (Sandbox Code Playgroud)\n\n该项目部署到 Google Cloud 后工作正常,那么问题出在哪里呢?
\n\n我尝试运行它,sudo但没有帮助。
我使用的是带有 WSL (Ubuntu) 的 Windows 10。
\nSai*_*eem 13
正如此评论中所讨论的,设置为我解决了这个问题"host": "127.0.0.1"。firebase.json
{
"firestore": {
"rules": "firestore.rules",
"indexes": "firestore.indexes.json"
},
"emulators": {
"firestore": {
"port": 5000,
"host": "127.0.0.1"
},
"ui": {
"enabled": true
}
}
}
Run Code Online (Sandbox Code Playgroud)
小智 0
--no-localhost使用任何选项firebase emulator或firebase serve
检查firebase login https://firebase.google.com/docs/cli#sign-in-test-cli上的此注释
,但我检查过,如果使用 WSL,这适用于所有命令