Google cloud platform 谷歌云功能无法部署
我正在学习谷歌云功能的教程。 尝试从命令行部署hello world返回 错误:(gcloud.beta.functions.deploy)集合[cloudfunctions.projects.locations]中字段[locationsId]的值是必需的,但未提供 部署命令是Google cloud platform 谷歌云功能无法部署,google-cloud-platform,google-cloud-functions,Google Cloud Platform,Google Cloud Functions,我正在学习谷歌云功能的教程。 尝试从命令行部署hello world返回 错误:(gcloud.beta.functions.deploy)集合[cloudfunctions.projects.locations]中字段[locationsId]的值是必需的,但未提供 部署命令是 gcloud beta functions deploy helloWorld --stage-bucket shopping-functions --trigger-topic hello_world 在我看来,你
gcloud beta functions deploy helloWorld --stage-bucket shopping-functions --trigger-topic hello_world
在我看来,你没有正确地设置项目 您是否设置了一个要使用云功能的项目?您可以通过调用
gcloud info
来查找它。您还可以尝试使用gcloud init
重新初始化您的环境
让我知道这是否有帮助 您是否使用“firebase部署”命令部署了任何功能?在我将所有功能切换到gcloud或firebase之前,我也遇到了同样的问题。它们似乎还不能很好地配合使用。确保为您的功能设置一个区域。您可以添加--region标志来覆盖此命令调用的默认函数/区域属性值。因为,我在命令中附加了--region选项,它解决了以下问题:
gcloud beta functions deploy helloWorld --stage-bucket your-bucket --trigger-topic hello_world --region=us-central1
或者,您可以使用gcloud config set
设置默认函数/区域,并且每次都可以跳过指定函数的区域
gcloud config set functions/region us-central1
我正要这么说——这就是答案。