Error: Sorry, we cannot connect to Google Cloud Services without a project ID. You may
specify one with an environment variable named "GCLOUD_PROJECT". See
https://googlecloudplatform.github.io/google-cloud-node/#//docs/guides/authentication
for a detailed guide on creating an authenticated connection.
Problem
After running
gcloud beta auth application-default loginI should be able to use google-cloud-node to access Google Cloud Platform services, but I can't. I must set theGCLOUD_PROJECTenv var or explicitly pass a project ID to a client for google-cloud-node to work.Steps to reproduce
gcloud init, you'll be prompted to set a default projectgcloud beta auth application-default loginand follow the OAuth 2.0 flow to logincd nodejs-docs-samples/storagenpm installnode buckets.js listObserve the error:
buckets.jsto explicitly pass in a project IDnode buckets.js listbuckets.jsGCLOUD_PROJECTenv var to your project IDnode buckets.js listExpected
cd nodejs-docs-samples/storagegcloud beta auth application-default loginnode buckets.js list(No env vars are set, code does not pass project ID to client)