简体   繁体   English

即使设置环境后也无法加载默认凭据

[英]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.

相关问题 admin.auth().verifyIdToken(idToken) 错误:在 8.0.0 之后无法使用 firebase-admin 加载默认凭据 - admin.auth().verifyIdToken(idToken) Error: Could not load the default credentials whith firebase-admin after to 8.0.0 谷歌云抛出错误:无法在 Nodejs 中加载默认凭据 - Google Cloud Throwing Error : Could not load the default credentials in Nodejs 无法加载默认凭据? (Node.js 谷歌计算引擎) - Could not load the default credentials? (Node.js Google Compute Engine) Dialog api v2 - 获取应用程序默认凭据时出现意外错误:无法加载默认凭据 - Dialog api v2 - Unexpected error while acquiring application default credentials: Could not load the default credentials “无法加载默认凭据”- 使用模拟器的 PubSub Node.js 模块 - "Could not load the default credentials" - PubSub Node.js module using the Emulator TwiML 应用程序和 Firebase 抛出未处理的承诺拒绝:错误:无法加载默认凭据 - TwiML app and Firebase throwing Unhandled promise rejection: Error: Could not load the default credentials 无法加载默认凭据? (Node.js 谷歌计算引擎教程) - Could not load the default credentials? (Node.js Google Compute Engine tutorial) “无法加载默认凭据”谷歌云机密管理器 - 使用 CLI 授权用户 - "Could not load default credentials" google cloud secrets manager - use CLI authorized user 无法从NodeJS中的任何提供程序加载凭据 - Could not load credentials from any providers in NodeJS 尝试通过 Next.js API 路由上的 admin.firestore.v1.FirestoreAdminClient 导出备份。 错误:无法加载默认凭据 - Trying to export backup via admin.firestore.v1.FirestoreAdminClient on a Next.js API route. Error: Could not load the default credentials
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM