当我尝试部署 firebase 功能(基本的 hello world)时,我收到此错误:FetchError:无法获取本地颁发者证书

问题描述 投票:0回答:3

按照 YouTube 教程就遇到了这个问题,尝试向 Firebase 团队发送电子邮件,但他们找不到解决方案。谁能解释一下这个证书是什么以及做什么?

t这是调试日志:

[debug] [2022-08-09T22:16:25.433Z] ----------------------------------------------------------------------
[debug] [2022-08-09T22:16:25.435Z] Command:       /Users/user/.nvm/versions/node/v18.6.0/bin/node /Users/user/.nvm/versions/node/v18.6.0/bin/firebase init --debug
[debug] [2022-08-09T22:16:25.436Z] CLI Version:   11.5.0
[debug] [2022-08-09T22:16:25.436Z] Platform:      darwin
[debug] [2022-08-09T22:16:25.436Z] Node Version:  v18.6.0
[debug] [2022-08-09T22:16:25.437Z] Time:          Wed Aug 10 2022 01:16:25 GMT+0300 (Israel Daylight Time)
[debug] [2022-08-09T22:16:25.437Z] ----------------------------------------------------------------------
[debug] 
[debug] [2022-08-09T22:16:25.442Z] > 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"]
[debug] [2022-08-09T22:16:25.443Z] > authorizing via signed-in user ([email protected])
[info] 
     ######## #### ########  ######## ########     ###     ######  ########
     ##        ##  ##     ## ##       ##     ##  ##   ##  ##       ##
     ######    ##  ########  ######   ########  #########  ######  ######
     ##        ##  ##    ##  ##       ##     ## ##     ##       ## ##
     ##       #### ##     ## ######## ########  ##     ##  ######  ########

You're about to initialize a Firebase project in this directory:

  /Users/user/firecast

[info] 
=== Project Setup
[info] 
[info] First, let's associate this project directory with a Firebase project.
[info] You can create multiple project aliases by running firebase use --add, 
[info] but for now we'll just set up a default project.
[info] 
[debug] [2022-08-09T22:16:33.391Z] >>> [apiv2][query] GET https://firebase.googleapis.com/v1beta1/projects pageSize=100
[debug] [2022-08-09T22:16:34.333Z] <<< [apiv2][status] GET https://firebase.googleapis.com/v1beta1/projects 200
[debug] [2022-08-09T22:16:34.334Z] <<< [apiv2][body] GET https://firebase.googleapis.com/v1beta1/projects [omitted]
[info] i  Using project learning-functions-ec917 (Learning-Functions) 
[info] 
=== Functions Setup
[info] 
[info] A functions directory will be created in your project with sample code
[info] pre-configured. Functions can be deployed with firebase deploy.
[info] 
[debug] [2022-08-09T22:16:37.246Z] > 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"]
[debug] [2022-08-09T22:16:37.247Z] > authorizing via signed-in user ([email protected])
[debug] [2022-08-09T22:16:37.247Z] [iam] checking project learning-functions-ec917 for permissions ["firebase.projects.get"]
[debug] [2022-08-09T22:16:37.248Z] >>> [apiv2][query] POST https://cloudresourcemanager.googleapis.com/v1/projects/learning-functions-ec917:testIamPermissions [none]
[debug] [2022-08-09T22:16:37.248Z] >>> [apiv2][(partial)header] POST https://cloudresourcemanager.googleapis.com/v1/projects/learning-functions-ec917:testIamPermissions x-goog-quota-user=projects/learning-functions-ec917
[debug] [2022-08-09T22:16:37.248Z] >>> [apiv2][body] POST https://cloudresourcemanager.googleapis.com/v1/projects/learning-functions-ec917:testIamPermissions {"permissions":["firebase.projects.get"]}
[debug] [2022-08-09T22:16:38.442Z] <<< [apiv2][status] POST https://cloudresourcemanager.googleapis.com/v1/projects/learning-functions-ec917:testIamPermissions 200
[debug] [2022-08-09T22:16:38.442Z] <<< [apiv2][body] POST https://cloudresourcemanager.googleapis.com/v1/projects/learning-functions-ec917:testIamPermissions {"permissions":["firebase.projects.get"]}
[debug] [2022-08-09T22:16:38.443Z] >>> [apiv2][query] GET https://serviceusage.googleapis.com/v1/projects/learning-functions-ec917/services/cloudfunctions.googleapis.com [none]
[debug] [2022-08-09T22:16:38.445Z] >>> [apiv2][query] GET https://serviceusage.googleapis.com/v1/projects/learning-functions-ec917/services/runtimeconfig.googleapis.com [none]
[debug] [2022-08-09T22:16:39.673Z] <<< [apiv2][status] GET https://serviceusage.googleapis.com/v1/projects/learning-functions-ec917/services/cloudfunctions.googleapis.com 200
[debug] [2022-08-09T22:16:39.673Z] <<< [apiv2][body] GET https://serviceusage.googleapis.com/v1/projects/learning-functions-ec917/services/cloudfunctions.googleapis.com [omitted]
[debug] [2022-08-09T22:16:39.674Z] <<< [apiv2][status] GET https://serviceusage.googleapis.com/v1/projects/learning-functions-ec917/services/runtimeconfig.googleapis.com 200
[debug] [2022-08-09T22:16:39.674Z] <<< [apiv2][body] GET https://serviceusage.googleapis.com/v1/projects/learning-functions-ec917/services/runtimeconfig.googleapis.com [omitted]
[info] ✔  Wrote functions/package.json 
[info] ✔  Wrote functions/.eslintrc.js 
[info] ✔  Wrote functions/index.js 
[info] ✔  Wrote functions/.gitignore 
[info] 
[info] i  Writing configuration info to firebase.json... 
[info] i  Writing project information to .firebaserc... 
[info] i  Writing gitignore file to .gitignore... 
[info] 
[info] ✔  Firebase initialization complete! 
[debug] [2022-08-09T22:17:37.933Z] ----------------------------------------------------------------------
[debug] [2022-08-09T22:17:37.934Z] Command:       /Users/user/.nvm/versions/node/v18.6.0/bin/node /Users/user/.nvm/versions/node/v18.6.0/bin/firebase deploy --debug
[debug] [2022-08-09T22:17:37.935Z] CLI Version:   11.5.0
[debug] [2022-08-09T22:17:37.935Z] Platform:      darwin
[debug] [2022-08-09T22:17:37.935Z] Node Version:  v18.6.0
[debug] [2022-08-09T22:17:37.936Z] Time:          Wed Aug 10 2022 01:17:37 GMT+0300 (Israel Daylight Time)
[debug] [2022-08-09T22:17:37.936Z] ----------------------------------------------------------------------
[debug] 
[debug] [2022-08-09T22:17:37.989Z] > 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"]
[debug] [2022-08-09T22:17:37.991Z] > authorizing via signed-in user ([email protected])
[debug] [2022-08-09T22:17:37.991Z] [iam] checking project learning-functions-ec917 for permissions ["cloudfunctions.functions.create","cloudfunctions.functions.delete","cloudfunctions.functions.get","cloudfunctions.functions.list","cloudfunctions.functions.update","cloudfunctions.operations.get","firebase.projects.get"]
[debug] [2022-08-09T22:17:37.993Z] >>> [apiv2][query] POST https://cloudresourcemanager.googleapis.com/v1/projects/learning-functions-ec917:testIamPermissions [none]
[debug] [2022-08-09T22:17:37.993Z] >>> [apiv2][(partial)header] POST https://cloudresourcemanager.googleapis.com/v1/projects/learning-functions-ec917:testIamPermissions x-goog-quota-user=projects/learning-functions-ec917
[debug] [2022-08-09T22:17:37.993Z] >>> [apiv2][body] POST https://cloudresourcemanager.googleapis.com/v1/projects/learning-functions-ec917:testIamPermissions {"permissions":["cloudfunctions.functions.create","cloudfunctions.functions.delete","cloudfunctions.functions.get","cloudfunctions.functions.list","cloudfunctions.functions.update","cloudfunctions.operations.get","firebase.projects.get"]}
[debug] [2022-08-09T22:17:39.198Z] <<< [apiv2][status] POST https://cloudresourcemanager.googleapis.com/v1/projects/learning-functions-ec917:testIamPermissions 200
[debug] [2022-08-09T22:17:39.198Z] <<< [apiv2][body] POST https://cloudresourcemanager.googleapis.com/v1/projects/learning-functions-ec917:testIamPermissions {"permissions":["cloudfunctions.functions.create","cloudfunctions.functions.delete","cloudfunctions.functions.get","cloudfunctions.functions.list","cloudfunctions.functions.update","cloudfunctions.operations.get","firebase.projects.get"]}
[debug] [2022-08-09T22:17:39.199Z] >>> [apiv2][query] POST https://iam.googleapis.com/v1/projects/learning-functions-ec917/serviceAccounts/[email protected]:testIamPermissions [none]
[debug] [2022-08-09T22:17:39.199Z] >>> [apiv2][body] POST https://iam.googleapis.com/v1/projects/learning-functions-ec917/serviceAccounts/[email protected]:testIamPermissions {"permissions":["iam.serviceAccounts.actAs"]}
[debug] [2022-08-09T22:17:40.188Z] <<< [apiv2][status] POST https://iam.googleapis.com/v1/projects/learning-functions-ec917/serviceAccounts/[email protected]:testIamPermissions 200
[debug] [2022-08-09T22:17:40.189Z] <<< [apiv2][body] POST https://iam.googleapis.com/v1/projects/learning-functions-ec917/serviceAccounts/[email protected]:testIamPermissions {"permissions":["iam.serviceAccounts.actAs"]}
[info] 
[info] === Deploying to 'learning-functions-ec917'...
[info] 
[info] i  deploying functions 
[info] Running command: npm --prefix "$RESOURCE_DIR" run lint
[info] ✔  functions: Finished running predeploy script. 
[debug] [2022-08-09T22:17:41.908Z] >>> [apiv2][query] GET https://firebase.googleapis.com/v1beta1/projects/learning-functions-ec917 [none]
[debug] [2022-08-09T22:17:42.645Z] <<< [apiv2][status] GET https://firebase.googleapis.com/v1beta1/projects/learning-functions-ec917 200
[debug] [2022-08-09T22:17:42.645Z] <<< [apiv2][body] GET https://firebase.googleapis.com/v1beta1/projects/learning-functions-ec917 {"projectId":"learning-functions-ec917","projectNumber":"413579619983","displayName":"Learning-Functions","name":"projects/learning-functions-ec917","resources":{"hostingSite":"learning-functions-ec917","storageBucket":"learning-functions-ec917.appspot.com","locationId":"europe-west"},"state":"ACTIVE","etag":"1_918b648a-7b9e-4057-80bf-6c1709a23bc2"}
[info] i  functions: ensuring required API cloudfunctions.googleapis.com is enabled... 
[info] i  functions: ensuring required API cloudbuild.googleapis.com is enabled... 
[info] i  artifactregistry: ensuring required API artifactregistry.googleapis.com is enabled... 
[debug] [2022-08-09T22:17:42.647Z] >>> [apiv2][query] GET https://serviceusage.googleapis.com/v1/projects/learning-functions-ec917/services/cloudfunctions.googleapis.com [none]
[debug] [2022-08-09T22:17:42.649Z] >>> [apiv2][query] GET https://serviceusage.googleapis.com/v1/projects/learning-functions-ec917/services/runtimeconfig.googleapis.com [none]
[debug] [2022-08-09T22:17:42.650Z] >>> [apiv2][query] GET https://serviceusage.googleapis.com/v1/projects/learning-functions-ec917/services/cloudbuild.googleapis.com [none]
[debug] [2022-08-09T22:17:42.652Z] >>> [apiv2][query] GET https://serviceusage.googleapis.com/v1/projects/learning-functions-ec917/services/artifactregistry.googleapis.com [none]
[debug] [2022-08-09T22:17:43.877Z] <<< [apiv2][status] GET https://serviceusage.googleapis.com/v1/projects/learning-functions-ec917/services/artifactregistry.googleapis.com 200
[debug] [2022-08-09T22:17:43.877Z] <<< [apiv2][body] GET https://serviceusage.googleapis.com/v1/projects/learning-functions-ec917/services/artifactregistry.googleapis.com [omitted]
[info] ✔  artifactregistry: required API artifactregistry.googleapis.com is enabled 
[debug] [2022-08-09T22:17:43.879Z] <<< [apiv2][status] GET https://serviceusage.googleapis.com/v1/projects/learning-functions-ec917/services/cloudfunctions.googleapis.com 200
[debug] [2022-08-09T22:17:43.879Z] <<< [apiv2][body] GET https://serviceusage.googleapis.com/v1/projects/learning-functions-ec917/services/cloudfunctions.googleapis.com [omitted]
[info] ✔  functions: required API cloudfunctions.googleapis.com is enabled 
[debug] [2022-08-09T22:17:43.880Z] <<< [apiv2][status] GET https://serviceusage.googleapis.com/v1/projects/learning-functions-ec917/services/cloudbuild.googleapis.com 200
[debug] [2022-08-09T22:17:43.880Z] <<< [apiv2][body] GET https://serviceusage.googleapis.com/v1/projects/learning-functions-ec917/services/cloudbuild.googleapis.com [omitted]
[info] ✔  functions: required API cloudbuild.googleapis.com is enabled 
[debug] [2022-08-09T22:17:43.881Z] <<< [apiv2][status] GET https://serviceusage.googleapis.com/v1/projects/learning-functions-ec917/services/runtimeconfig.googleapis.com 200
[debug] [2022-08-09T22:17:43.881Z] <<< [apiv2][body] GET https://serviceusage.googleapis.com/v1/projects/learning-functions-ec917/services/runtimeconfig.googleapis.com [omitted]
[debug] [2022-08-09T22:17:43.881Z] >>> [apiv2][query] GET https://firebase.googleapis.com/v1beta1/projects/learning-functions-ec917/adminSdkConfig [none]
[debug] [2022-08-09T22:17:44.295Z] <<< [apiv2][status] GET https://firebase.googleapis.com/v1beta1/projects/learning-functions-ec917/adminSdkConfig 200
[debug] [2022-08-09T22:17:44.295Z] <<< [apiv2][body] GET https://firebase.googleapis.com/v1beta1/projects/learning-functions-ec917/adminSdkConfig {"projectId":"learning-functions-ec917","storageBucket":"learning-functions-ec917.appspot.com","locationId":"europe-west"}
[debug] [2022-08-09T22:17:44.296Z] >>> [apiv2][query] GET https://runtimeconfig.googleapis.com/v1beta1/projects/learning-functions-ec917/configs [none]
[debug] [2022-08-09T22:17:44.796Z] <<< [apiv2][status] GET https://runtimeconfig.googleapis.com/v1beta1/projects/learning-functions-ec917/configs 200
[debug] [2022-08-09T22:17:44.796Z] <<< [apiv2][body] GET https://runtimeconfig.googleapis.com/v1beta1/projects/learning-functions-ec917/configs {}
[info] i  functions: preparing codebase default for deployment 
[debug] [2022-08-09T22:17:44.798Z] Validating nodejs source
[debug] [2022-08-09T22:17:46.533Z] > [functions] package.json contents: {
  "name": "functions",
  "description": "Cloud Functions for Firebase",
  "scripts": {
    "lint": "eslint .",
    "serve": "firebase emulators:start --only functions",
    "shell": "firebase functions:shell",
    "start": "npm run shell",
    "deploy": "firebase deploy --only functions",
    "logs": "firebase functions:log"
  },
  "engines": {
    "node": "16"
  },
  "main": "index.js",
  "dependencies": {
    "firebase-admin": "^10.0.2",
    "firebase-functions": "^3.18.0"
  },
  "devDependencies": {
    "eslint": "^8.9.0",
    "eslint-config-google": "^0.14.0",
    "firebase-functions-test": "^0.2.0"
  },
  "private": true
}
[debug] [2022-08-09T22:17:46.533Z] Building nodejs source
[debug] [2022-08-09T22:17:46.536Z] Could not find functions.yaml. Must use http discovery
[debug] [2022-08-09T22:17:47.099Z] Serving at port 9005

[debug] [2022-08-09T22:17:47.147Z] Got response from /__/functions.yaml {"endpoints":{"helloWorld":{"platform":"gcfv1","httpsTrigger":{},"entryPoint":"helloWorld"}},"specVersion":"v1alpha1","requiredAPIs":[]}
[debug] [2022-08-09T22:17:47.162Z] shutdown requested via /__/quitquitquit

[info] i  functions: preparing functions directory for uploading... 
[info] i  functions: packaged /Users/user/firecast/functions (78.17 KB) for uploading 
[debug] [2022-08-09T22:17:47.249Z] >>> [apiv2][query] GET https://cloudfunctions.googleapis.com/v1/projects/learning-functions-ec917/locations/-/functions [none]
[debug] [2022-08-09T22:17:48.174Z] <<< [apiv2][status] GET https://cloudfunctions.googleapis.com/v1/projects/learning-functions-ec917/locations/-/functions 200
[debug] [2022-08-09T22:17:48.175Z] <<< [apiv2][body] GET https://cloudfunctions.googleapis.com/v1/projects/learning-functions-ec917/locations/-/functions {}
[debug] [2022-08-09T22:17:48.175Z] >>> [apiv2][query] GET https://cloudfunctions.googleapis.com/v2alpha/projects/learning-functions-ec917/locations/-/functions [none]
[debug] [2022-08-09T22:17:49.709Z] <<< [apiv2][status] GET https://cloudfunctions.googleapis.com/v2alpha/projects/learning-functions-ec917/locations/-/functions 200
[debug] [2022-08-09T22:17:49.709Z] <<< [apiv2][body] GET https://cloudfunctions.googleapis.com/v2alpha/projects/learning-functions-ec917/locations/-/functions {}
[debug] [2022-08-09T22:17:49.716Z] >>> [apiv2][query] GET https://firebase.googleapis.com/v1beta1/projects/learning-functions-ec917 [none]
[debug] [2022-08-09T22:17:50.324Z] <<< [apiv2][status] GET https://firebase.googleapis.com/v1beta1/projects/learning-functions-ec917 200
[debug] [2022-08-09T22:17:50.324Z] <<< [apiv2][body] GET https://firebase.googleapis.com/v1beta1/projects/learning-functions-ec917 {"projectId":"learning-functions-ec917","projectNumber":"413579619983","displayName":"Learning-Functions","name":"projects/learning-functions-ec917","resources":{"hostingSite":"learning-functions-ec917","storageBucket":"learning-functions-ec917.appspot.com","locationId":"europe-west"},"state":"ACTIVE","etag":"1_918b648a-7b9e-4057-80bf-6c1709a23bc2"}
[debug] [2022-08-09T22:17:50.325Z] [functions] found 1 new HTTP functions, testing setIamPolicy permission...
[debug] [2022-08-09T22:17:50.325Z] >>> [apiv2][query] POST https://cloudresourcemanager.googleapis.com/v1/projects/learning-functions-ec917:testIamPermissions [none]
[debug] [2022-08-09T22:17:50.325Z] >>> [apiv2][(partial)header] POST https://cloudresourcemanager.googleapis.com/v1/projects/learning-functions-ec917:testIamPermissions x-goog-quota-user=projects/learning-functions-ec917
[debug] [2022-08-09T22:17:50.325Z] >>> [apiv2][body] POST https://cloudresourcemanager.googleapis.com/v1/projects/learning-functions-ec917:testIamPermissions {"permissions":["cloudfunctions.functions.setIamPolicy"]}
[debug] [2022-08-09T22:17:50.882Z] <<< [apiv2][status] POST https://cloudresourcemanager.googleapis.com/v1/projects/learning-functions-ec917:testIamPermissions 200
[debug] [2022-08-09T22:17:50.882Z] <<< [apiv2][body] POST https://cloudresourcemanager.googleapis.com/v1/projects/learning-functions-ec917:testIamPermissions {"permissions":["cloudfunctions.functions.setIamPolicy"]}
[debug] [2022-08-09T22:17:50.882Z] [functions] found setIamPolicy permission, proceeding with deploy
[debug] [2022-08-09T22:17:50.884Z] >>> [apiv2][query] POST https://cloudfunctions.googleapis.com/v1/projects/learning-functions-ec917/locations/us-central1/functions:generateUploadUrl [none]
[debug] [2022-08-09T22:17:50.884Z] >>> [apiv2][body] POST https://cloudfunctions.googleapis.com/v1/projects/learning-functions-ec917/locations/us-central1/functions:generateUploadUrl {}
[debug] [2022-08-09T22:17:51.984Z] <<< [apiv2][status] POST https://cloudfunctions.googleapis.com/v1/projects/learning-functions-ec917/locations/us-central1/functions:generateUploadUrl 200
[debug] [2022-08-09T22:17:51.984Z] <<< [apiv2][body] POST https://cloudfunctions.googleapis.com/v1/projects/learning-functions-ec917/locations/us-central1/functions:generateUploadUrl {"uploadUrl":"https://storage.googleapis.com/uploads-133252297600.us-central1.cloudfunctions.appspot.com/fb49dcb9-99ee-49f2-a376-77b8e49cdd12.zip?GoogleAccessId=service-413579619983@gcf-admin-robot.iam.gserviceaccount.com&Expires=1660085271&Signature=VJafnT5lDGufLYXytUmHQImwgmy5%2BQQavy%2BVjBUGPMQXCtLsXrvKdnQ3hOoYzCdNsq2ASUWgVe1vX6UGj%2FdPgG%2FtKOzvaLHUhQ883%2FVNsDo9hTlO2NDrQ4H%2BgxqLam3IitziX609ozpiotMR21lNMrnWqNOtlBGbYsQYki%2FY3G4etUZqJHZE5UKQpn7WhTAUjJCNcD1z5oL3FUQogxa0UAa6HQTFxvBlI2%2BjqRtctftJ5ruyxLoekswhfxMBG19Rw9W%2F6uj38BCLOap1ndMSfxV2im%2BvSPSJ4ikeQQ%2B7R6Vw5RkKtVJr8YZNW6SM6kjzTClsAjk9M2tog9taoSjfOg%3D%3D"}
[debug] [2022-08-09T22:17:51.985Z] >>> [apiv2][query] PUT https://storage.googleapis.com/uploads-133252297600.us-central1.cloudfunctions.appspot.com/fb49dcb9-99ee-49f2-a376-77b8e49cdd12.zip GoogleAccessId=service-413579619983%40gcf-admin-robot.iam.gserviceaccount.com&Expires=1660085271&Signature=VJafnT5lDGufLYXytUmHQImwgmy5%2BQQavy%2BVjBUGPMQXCtLsXrvKdnQ3hOoYzCdNsq2ASUWgVe1vX6UGj%2FdPgG%2FtKOzvaLHUhQ883%2FVNsDo9hTlO2NDrQ4H%2BgxqLam3IitziX609ozpiotMR21lNMrnWqNOtlBGbYsQYki%2FY3G4etUZqJHZE5UKQpn7WhTAUjJCNcD1z5oL3FUQogxa0UAa6HQTFxvBlI2%2BjqRtctftJ5ruyxLoekswhfxMBG19Rw9W%2F6uj38BCLOap1ndMSfxV2im%2BvSPSJ4ikeQQ%2B7R6Vw5RkKtVJr8YZNW6SM6kjzTClsAjk9M2tog9taoSjfOg%3D%3D
[debug] [2022-08-09T22:17:51.985Z] >>> [apiv2][body] PUT https://storage.googleapis.com/uploads-133252297600.us-central1.cloudfunctions.appspot.com/fb49dcb9-99ee-49f2-a376-77b8e49cdd12.zip [stream]
[warn] ⚠  functions: Upload Error: Failed to make request to https://storage.googleapis.com/uploads-133252297600.us-central1.cloudfunctions.appspot.com/fb49dcb9-99ee-49f2-a376-77b8e49cdd12.zip?GoogleAccessId=service-413579619983%40gcf-admin-robot.iam.gserviceaccount.com&Expires=1660085271&Signature=VJafnT5lDGufLYXytUmHQImwgmy5%2BQQavy%2BVjBUGPMQXCtLsXrvKdnQ3hOoYzCdNsq2ASUWgVe1vX6UGj%2FdPgG%2FtKOzvaLHUhQ883%2FVNsDo9hTlO2NDrQ4H%2BgxqLam3IitziX609ozpiotMR21lNMrnWqNOtlBGbYsQYki%2FY3G4etUZqJHZE5UKQpn7WhTAUjJCNcD1z5oL3FUQogxa0UAa6HQTFxvBlI2%2BjqRtctftJ5ruyxLoekswhfxMBG19Rw9W%2F6uj38BCLOap1ndMSfxV2im%2BvSPSJ4ikeQQ%2B7R6Vw5RkKtVJr8YZNW6SM6kjzTClsAjk9M2tog9taoSjfOg%3D%3D 
[debug] [2022-08-09T22:17:52.375Z] FetchError: request to https://storage.googleapis.com/uploads-133252297600.us-central1.cloudfunctions.appspot.com/fb49dcb9-99ee-49f2-a376-77b8e49cdd12.zip?GoogleAccessId=service-413579619983%40gcf-admin-robot.iam.gserviceaccount.com&Expires=1660085271&Signature=VJafnT5lDGufLYXytUmHQImwgmy5%2BQQavy%2BVjBUGPMQXCtLsXrvKdnQ3hOoYzCdNsq2ASUWgVe1vX6UGj%2FdPgG%2FtKOzvaLHUhQ883%2FVNsDo9hTlO2NDrQ4H%2BgxqLam3IitziX609ozpiotMR21lNMrnWqNOtlBGbYsQYki%2FY3G4etUZqJHZE5UKQpn7WhTAUjJCNcD1z5oL3FUQogxa0UAa6HQTFxvBlI2%2BjqRtctftJ5ruyxLoekswhfxMBG19Rw9W%2F6uj38BCLOap1ndMSfxV2im%2BvSPSJ4ikeQQ%2B7R6Vw5RkKtVJr8YZNW6SM6kjzTClsAjk9M2tog9taoSjfOg%3D%3D failed, reason: unable to get local issuer certificate
    at ClientRequest.<anonymous> (/Users/user/.nvm/versions/node/v18.6.0/lib/node_modules/firebase-tools/node_modules/node-fetch/lib/index.js:1491:11)
    at ClientRequest.emit (node:events:525:35)
    at ClientRequest.emit (node:domain:482:12)
    at TLSSocket.socketErrorListener (node:_http_client:481:9)
    at TLSSocket.emit (node:events:513:28)
    at TLSSocket.emit (node:domain:482:12)
    at emitErrorNT (node:internal/streams/destroy:151:8)
    at emitErrorCloseNT (node:internal/streams/destroy:116:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
[error] 
[error] Error: Failed to make request to https://storage.googleapis.com/uploads-133252297600.us-central1.cloudfunctions.appspot.com/fb49dcb9-99ee-49f2-a376-77b8e49cdd12.zip?GoogleAccessId=service-413579619983%40gcf-admin-robot.iam.gserviceaccount.com&Expires=1660085271&Signature=VJafnT5lDGufLYXytUmHQImwgmy5%2BQQavy%2BVjBUGPMQXCtLsXrvKdnQ3hOoYzCdNsq2ASUWgVe1vX6UGj%2FdPgG%2FtKOzvaLHUhQ883%2FVNsDo9hTlO2NDrQ4H%2BgxqLam3IitziX609ozpiotMR21lNMrnWqNOtlBGbYsQYki%2FY3G4etUZqJHZE5UKQpn7WhTAUjJCNcD1z5oL3FUQogxa0UAa6HQTFxvBlI2%2BjqRtctftJ5ruyxLoekswhfxMBG19Rw9W%2F6uj38BCLOap1ndMSfxV2im%2BvSPSJ4ikeQQ%2B7R6Vw5RkKtVJr8YZNW6SM6kjzTClsAjk9M2tog9taoSjfOg%3D%3D

我真的不确定我可以对此添加什么,因为我对证书和此类问题不了解。

node.js firebase google-api google-cloud-functions certificate
3个回答
1
投票

原来我使用的是 Node v18,这是网站上的最新版本,但目前最新的 LTS(长期支持)版本是 16。 我将 Node 版本更改为 16,现在一切正常。


0
投票

我刚刚遇到了同样的错误。我使用两个独立的 firebase 项目,一个用于开发,一个用于生产。使用 firebase-cli 我刚刚添加了开发项目。我使用了 firebase use project-name-prod 但在部署云功能时遇到了问题。我使用了

firebase logout
,然后使用了
firebase login
,一切正常。当我尝试部署时,我的项目似乎在后端不同步。


0
投票

您需要使用兼容版本的 Node.js。通常是LTS

为了降级您的 Node 版本,您可以通过以下方式在终端中使用 brew

cd ~  
brew search node     
brew unlink node
brew install node@18

您可以在

node@18
打印的版本中将
brew search node
更改为您喜欢的任何版本。

© www.soinside.com 2019 - 2024. All rights reserved.