Error: HTTP Error: 400, Invalid JSON payload received. Unknown name "skipLog": Cannot find field

Error: HTTP Error: 400, Invalid JSON payload received. Unknown name "skipLog": Cannot find field

我是第一次尝试设置 firebase 功能。我按照 docs 中的步骤操作,但是当我 运行 firebase init functions 我 运行 进入这个错误:

Error: HTTP Error: 400, Invalid JSON payload received. Unknown name "skipLog": Cannot find field.

这是 firebase-debug.log 文件的摘录:

[debug] [2022-04-20T08:53:35.659Z] <<< [apiv2][body] POST https://serviceusage.googleapis.com/v1/projects/<my_project_name>/services/cloudfunctions.googleapis.com:enable {"error":{"code":400,"message":"Invalid JSON payload received. Unknown name \"skipLog\": Cannot find field.","status":"INVALID_ARGUMENT","details":[{"@type":"type.googleapis.com/google.rpc.BadRequest","fieldViolations":[{"description":"Invalid JSON payload received. Unknown name \"skipLog\": Cannot find field."}]}]}}
[error] 
[error] Error: HTTP Error: 400, Invalid JSON payload received. Unknown name "skipLog": Cannot find field.
[debug] [2022-04-20T08:53:35.670Z] Error Context: {
  "body": {
    "error": {
      "code": 400,
      "message": "Invalid JSON payload received. Unknown name \"skipLog\": Cannot find field.",
      "status": "INVALID_ARGUMENT",
      "details": [
        {
          "@type": "type.googleapis.com/google.rpc.BadRequest",
          "fieldViolations": [
            {
              "description": "Invalid JSON payload received. Unknown name \"skipLog\": Cannot find field."
            }
          ]
        }
      ]
    }
  },
  "response": {
    "statusCode": 400
  }
}

我遇到了同样的问题,设法用 firebase-tools

的旧版本 (10.6.0) 初始化函数

要使用版本 10.6.0 卸载并重新安装:

npm uninstall -g firebase-tools
npm install -g firebase-tools@10.6.0

我根据此处的答案遵循了这些说明,它完美地帮助我克服了同样的错误。我们应该稍后 re-upgrade 稍后再 firebase-tools 吗?

要使用版本 10.6.0 卸载并重新安装:

npm uninstall -g firebase-tools npm install -g firebase-tools@10.6.0

这解决了我的问题。

curl -sL https://firebase.tools | upgrade=true bash
-- Checking for existing firebase-tools on PATH...
-- Your machine has firebase-tools@10.7.0, attempting upgrade...
-- Checking your machine type...
-- Downloading binary from https://firebase.tools/bin/linux/latest
######################################################################## 100.0%#=#=#                                                                         
-- Setting permissions on binary...
-- Checking your PATH variable...
-- firebase-tools@10.8.0 is now installed
-- All Done!