google-cloud-platform - gcloud 停止工作 - "was unexpected at this time."

标签 google-cloud-platform gcloud google-cloud-sdk

我刚刚在 Windows 10 上更新了我的 google cloud SDK(gcloud 组件更新)。 更新后,gcloud 命令停止工作。 我得到的只是(例如:gcloud -h): PATH\lib\gcloud.py“-h”这时候出乎意料了。

我尝试重新安装但没有帮助:(

enter image description here

最佳答案

正如其他答案中所述,这是 274.0.0 版本的 gcloud 的一个错误。 Another report of this issue实际上确定了错误所在并提供了此修复:

If you are stuck and need an immediate solution, here's a workaround that will move you forward, but you should reinstall the Cloud SDK from scratch when a fix is ready.

  1. Open C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk-bin\gcloud.cmd in your editor
  2. Near line 170, change ) ELSE ( to be just )
  3. Remove the ) on the last line in the file.

这应该可以让您在短期内工作(尽管每次运行命令时都会出现无关的错误消息)。让它工作后,您可以使用以下方法恢复到版本 273.0.0(以便您停止收到错误消息并且不使用修改后的版本):

gcloud components update --version=273.0.0

关于google-cloud-platform - gcloud 停止工作 - "was unexpected at this time.",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59418255/

相关文章:

json - 在 docker-compose.yml 中传递 Json 文件内容

gcloud - 沉默 `gcloud auth activate-service-account`

google-cloud-platform - GOOGLE_APPLICATION_CREDENTIALS 错误

reactjs - 在 Google Kubernetes 上设置 react app build 文件夹

google-app-engine - 托管 VM 部署在 "Copying certificates for secure access..."上挂起

google-cloud-platform - gcloud-错误:(gcloud.app.deploy)权限错误,正在提取应用程序

google-cloud-platform - GCP : Identify correct instance(N1standard 8, N1Highmem 等)使用目录 API

python - 没有名为 appengine.api 的模块

node.js - 为什么 Eventarc 触发器在 Firebase 中不起作用?

google-cloud-platform - 标准 SQL 中的转置 - BigQuery