0

I set up env varible VISION_KEYFILE_JSON with key values of the vision app, when I console

console.log(`key: ${process.env.VISION_KEYFILE_JSON}`);

It gives the key, when executing the code

const client = new vision.ImageAnnotatorClient({ projectId: config.google.project_id});

I got the following error

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

How to solve this?

Rose Davidson
  • 652
  • 4
  • 7
Mariya James
  • 935
  • 2
  • 9
  • 27

1 Answers1

0

You need to also set GOOGLE_APPLICATION_CREDENTIALS for Application Default Credentials to work. I think setting it to the same value as VISION_KEYFILE_JSON is correct.

saiyr
  • 2,575
  • 1
  • 11
  • 13