Windows 下无法登录 gcloud 问题解决


需要设置代理,根据官网的方法:https://cloud.google.com/sdk/docs/proxy-settings?hl=zh-cn,这样设置:

gcloud config set proxy/type [PROXY_TYPE]

gcloud config set proxy/address [PROXY_IP_ADDRESS]

gcloud config set proxy/port [PROXY_PORT]

例如:

gcloud config set proxy/type http

gcloud config set proxy/address 127.0.0.1

gcloud config set proxy/port 7890

然后登录:

gcloud auth login [USERNAME]

注意,Windows 下会提示:

To login, run:
$ gcloud auth login `ACCOUNT`

实际上如果带上“的话会出错,直接写账号就行,例如:

gcloud auth login example@gmail.com