firebase函数:secrets:set is not a Firebase command

标签 firebase google-cloud-functions google-secret-manager

我正在使用云功能,并希望使用 Secret Manager 来保护某些服务的 api key 。遵循官方文档here ,我尝试使用命令:

firebase functions:secrets:set STRIPE_TEST

但我收到以下错误:

Error: functions:secrets:set is not a Firebase command. Did you mean functions:config:set?

我想使用 secret ,而不是不推荐的配置

最佳答案

我在 firebase-tools 版本 10.1.2 上遇到了同样的问题。目前有更新的版本 11.1.0 可用,但我在升级甚至卸载时遇到了问题:

$ firebase --version
10.1.2
$ npm i -g firebase-tools
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
...
$ firebase --version
10.1.2
$ npm uninstall --location=global firebase-tools
up to date, audited 1 package in 52ms
$ firebase --version
10.1.2

我发现我可以使用 curl -sL firebase.tools | 成功卸载 firebase-tools uninstall=true bash 然后我用 npm i --location=global firebase-tools

重新安装了它

最终将 firebase --version 升级到 11.1.0,为我修复了 firebasefunctions:secrets:set SECRET_NAME

关于firebase函数:secrets:set is not a Firebase command,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72785111/

相关文章:

firebase - 如何获取 Google Instance ID 服务的 IID_TOKEN?

android - 如何为 JSON 对象中的 Firebase 云消息传递发送 "event_time"?

google-cloud-platform - 如何使用 gcloud compute scp?

gcloud - 如何通过 gcloud shell 在 Cloud Run 部署中正确使用来自 Secret Manager 的 secret

ios - 验证 https 触发的云函数

android - 仅使用 ServerValue.TIMESTAMP 从 firebase 服务器获取时间和日期

reactjs - 在 useEffect React 中调用异步函数中的 Firebase v9 onSnapShot

node.js - 读取和写入 Firestore 的 Firebase 函数会抛出 ReferenceError : query is not defined at cors and Unhandled rejection

google-cloud-platform - 如何通过 Terraform 在 Google Cloud Secret Manager 中创建 key ?

google-cloud-platform - 无法从 Google Cloud Function 访问存储在 Secrets Manager 中的 key