[英]Could not load the default credentials even after setting env
I set up env varible VISION_KEYFILE_JSON with key values of the vision app, when I console 控制台时,我使用视觉应用程序的键值设置了环境变量VISION_KEYFILE_JSON
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. 浏览至https://developers.google.com/accounts/docs/application-default-credentials了解更多信息。
How to solve this? 如何解决呢?
You need to also set GOOGLE_APPLICATION_CREDENTIALS
for Application Default Credentials to work. 您还需要将GOOGLE_APPLICATION_CREDENTIALS
设置为“应用程序默认凭据”才能正常工作。 I think setting it to the same value as VISION_KEYFILE_JSON
is correct. 我认为将其设置为与VISION_KEYFILE_JSON
相同的值是正确的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.