Could not load the default credentials? (Node.js Google Compute Engine tutorial)

后端 未结 14 1587
情话喂你
情话喂你 2020-12-04 19:20

SITUATION:

I follow this tutorial: https://cloud.google.com/nodejs/tutorials/bookshelf-on-compute-engine

Everything works fine until I do

14条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-04 19:47

    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.

    Read this: https://developers.google.com/identity/protocols/application-default-credentials

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

    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.

提交回复
热议问题