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

I'm trying to setup firebase functions for the first time. I followed the steps in the docs, but when I run firebase init functions I run into this error:

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

Here is the extract from the firebase-debug.log file:

[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
  }
}


Solution 1:[1]

I had the same problem, managed to init functions with older version (10.6.0) of firebase-tools

Solution 2:[2]

To uninstall and reinstall using version 10.6.0:

npm uninstall -g firebase-tools
npm install -g [email protected]

Solution 3:[3]

This fixed the problem for me.

curl -sL https://firebase.tools | upgrade=true bash
-- Checking for existing firebase-tools on PATH...
-- Your machine has [email protected], 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...
-- [email protected] is now installed
-- All Done!

Solution 4:[4]

I followed these instructions based on the answer here and it worked perfectly for me to get past the same error. Should we then later re-upgrade the firebase-tools at a later time?

To uninstall and reinstall using version 10.6.0:

npm uninstall -g firebase-tools npm install -g [email protected]

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Samu Sarre
Solution 2 Bobberman
Solution 3 Blackbeard
Solution 4 Randall