无法加载默认凭据?(Node.js 谷歌计算引擎教程) [英] Could not load the default credentials? (Node.js Google Compute Engine tutorial)

查看:29
本文介绍了无法加载默认凭据?(Node.js 谷歌计算引擎教程)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

情况:

我遵循本教程:https://cloud.google.com/nodejs/tutorials/bookshelf-on-compute-engine

一切正常,直到我执行 npm start 并转到:

Everything works fine until I do npm start and go to:

http://localhost:8080

我在空白页上看到以下文字:

I am met with the following text on the blank page:

Could not load the default credentials. Browse to https://developers.google.com/accounts/docs/application-default-credentials for more information.

这毫无意义,因为我使用的是 OAuth.我点击了链接并阅读了页面,但我在任何地方都没有 GOOGLE-APPLICATION-CREDENTIALS 字段,教程中也没有任何相关内容.

Which makes no sense since I am using OAuth. I followed the link and read the page, but I have no GOOGLE-APPLICATION-CREDENTIALS field anywhere, and nothing about it in the tutorial.

问题:

能否请您重现这些步骤并告诉我您是否得到相同的结果?

Could you please reproduce the steps and tell me if you get the same result ?

(需要 5 分钟)

如果没有,我可能做错了什么?

If not, what could I have done wrong ?

推荐答案

是的,我遇到了同样的错误.这很烦人,因为谷歌云平台文档的入门"书架教程没有在任何地方提到这一点.这意味着任何尝试本教程的新开发人员都会看到此错误.

Yes, I had the same error. It's annoying cause Google Cloud Platform docs for their "getting started" bookshelf tutorial does not mention this anywhere. Which means that any new developer who tries this tutorial will see this error.

请阅读:https://developers.google.com/identity/protocols/application-default-credentials

我通过运行解决了这个问题:gcloud auth 应用-默认登录

I fixed this issue by running: gcloud auth application-default login

为了运行这个gcloud auth application-default login访问:https://cloud.google.com/sdk/install1)你必须在你的电脑上安装sdk2)这将使您能够运行代码3) 登录到您关联的 gmail 帐户,然后您就可以开始了!

In order to run thisgcloud auth application-default login Visit: https://cloud.google.com/sdk/install 1) You have to install sdk into your computer 2) That will enable you to run the code 3) Log in to your associated gmail account then you are good to go!

这将使您登录,然后您在本地编码将使用该身份验证.

This will make you login, and after that you code locally will use that authentication.

这篇关于无法加载默认凭据?(Node.js 谷歌计算引擎教程)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆