gpt4 book ai didi

Firebase Serve命令失败,错误为404

转载 作者:行者123 更新时间:2023-12-04 03:03:12 30 4
gpt4 key购买 nike

每当我在Mac上运行firebase serve时,我都会收到404错误...这以前从未发生过,而我只是在使用本地开发服务器之前,大约是在5分钟之前就开始发生。我已经删除了firebase.json文件并重新初始化,重新安装了firebase工具,但是每次都失败。这是在 Debug模式下运行命令的结果。

    firebase serve --debug
[2018-09-11T16:12:25.873Z] ----------------------------------------------------------------------
[2018-09-11T16:12:25.876Z] Command: /usr/local/bin/node /usr/local/bin/firebase serve --debug
[2018-09-11T16:12:25.877Z] CLI Version: 4.2.1
[2018-09-11T16:12:25.877Z] Platform: darwin
[2018-09-11T16:12:25.877Z] Node Version: v6.11.3
[2018-09-11T16:12:25.878Z] Time: Tue Sep 11 2018 11:12:25 GMT-0500 (CDT)
[2018-09-11T16:12:25.878Z] ----------------------------------------------------------------------

[2018-09-11T16:12:25.890Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
[2018-09-11T16:12:25.890Z] > authorizing via signed-in user
[2018-09-11T16:12:25.893Z] >>> HTTP REQUEST GET https://admin.firebase.com/v1/projects/skadaddle-10f24

[2018-09-11T16:12:26.210Z] <<< HTTP RESPONSE 200 server=nginx, date=Tue, 11 Sep 2018 16:12:26 GMT, content-type=application/json; charset=utf-8, content-length=114, connection=close, x-content-type-options=nosniff, strict-transport-security=max-age=31536000; includeSubdomains, cache-control=no-cache, no-store
[2018-09-11T16:12:26.212Z] >>> HTTP REQUEST GET https://cloudresourcemanager.googleapis.com/v1/projects/skadaddle-10f24

[2018-09-11T16:12:26.385Z] <<< HTTP RESPONSE 200 content-type=application/json; charset=UTF-8, vary=X-Origin, Referer, Origin,Accept-Encoding, date=Tue, 11 Sep 2018 16:12:26 GMT, server=ESF, cache-control=private, x-xss-protection=1; mode=block, x-frame-options=SAMEORIGIN, x-content-type-options=nosniff, alt-svc=quic=":443"; ma=2592000; v="44,43,39,35", accept-ranges=none, connection=close

=== Serving from '/Users/Kevin/Desktop/Source/Skadaddle'...

[2018-09-11T16:12:26.388Z] >>> HTTP REQUEST GET https://mobilesdk-pa.googleapis.com/v1/projects/255074367563/clients/_:getWebAppConfig

[2018-09-11T16:12:26.514Z] <<< HTTP RESPONSE 404 vary=X-Origin, Referer, Origin,Accept-Encoding, content-type=application/json; charset=UTF-8, date=Tue, 11 Sep 2018 16:12:26 GMT, server=ESF, cache-control=private, x-xss-protection=1; mode=block, x-frame-options=SAMEORIGIN, x-content-type-options=nosniff, alt-svc=quic=":443"; ma=2592000; v="44,43,39,35", accept-ranges=none, connection=close
[2018-09-11T16:12:26.514Z] <<< HTTP RESPONSE BODY code=404, message=Requested entity was not found., status=NOT_FOUND

Error: HTTP Error: 404, Requested entity was not found.
[2018-09-11T16:12:26.519Z] Error Context: {
"body": {
"error": {
"code": 404,
"message": "Requested entity was not found.",
"status": "NOT_FOUND"
}
},
"response": {
"statusCode": 404,
"body": {
"error": {
"code": 404,
"message": "Requested entity was not found.",
"status": "NOT_FOUND"
}
},
"headers": {
"vary": "X-Origin, Referer, Origin,Accept-Encoding",
"content-type": "application/json; charset=UTF-8",
"date": "Tue, 11 Sep 2018 16:12:26 GMT",
"server": "ESF",
"cache-control": "private",
"x-xss-protection": "1; mode=block",
"x-frame-options": "SAMEORIGIN",
"x-content-type-options": "nosniff",
"alt-svc": "quic=\":443\"; ma=2592000; v=\"44,43,39,35\"",
"accept-ranges": "none",
"connection": "close"
},
"request": {
"uri": {
"protocol": "https:",
"slashes": true,
"auth": null,
"host": "mobilesdk-pa.googleapis.com",
"port": 443,
"hostname": "mobilesdk-pa.googleapis.com",
"hash": null,
"search": null,
"query": null,
"pathname": "/v1/projects/255074367563/clients/_:getWebAppConfig",
"path": "/v1/projects/255074367563/clients/_:getWebAppConfig",
"href": "https://mobilesdk-pa.googleapis.com/v1/projects/255074367563/clients/_:getWebAppConfig"
},
"method": "GET"
}
}
}

最佳答案

问题出在Google。当您运行firebase serve时,它会向https://mobilesdk-pa.googleapis.com发送请求,该请求当前会引发404错误。

我可以通过在node_modules/firebase-tools/lib中编辑3个文件来解决此问题(临时修复)。
api.js的第99行是调用错误URL的地方。只需将其更改为任何有效的非404网址。

然后,在fetchWebSetup.js中,将"GET"之后的第9行的参数更改为空白字符串(例如return api.request("GET", "", {
与上面第51行的functionsConfig.js相同。

这应该可以使您立即启动并运行,但是当Google修复该URL时,它应该可以自行解决。

关于Firebase Serve命令失败,错误为404,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52280478/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com