ibm-watson - 错误:AssistantV1.BaseService.initCredentials 的构造函数参数中提供的凭据不足
问题描述
我正在构建一个虚拟助手,它使用这个文档来响应触发词。
我按照教程进行操作,运行时npm start
出现此错误。
C:\wat\node_modules\ibm-cloud-sdk-core\lib\base_service.js:307
throw new Error(errorMessage);
^
Error: Insufficient credentials provided in constructor argument. Refer to the documentation for the required parameters. Common examples are username/password and iam_apikey.
at AssistantV1.BaseService.initCredentials (C:\wat\node_modules\ibm-cloud-sdk-core\lib\base_service.js:307:23)
at AssistantV1.BaseService (C:\wat\node_modules\ibm-cloud-sdk-core\lib\base_service.js:113:29)
at new AssistantV1 (C:\wat\node_modules\ibm-watson\assistant\v1.js:66:28)
at Object.<anonymous> (C:\wat\run.js:24:22)
at Module._compile (internal/modules/cjs/loader.js:936:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:947:10)
at Module.load (internal/modules/cjs/loader.js:790:32)
at Function.Module._load (internal/modules/cjs/loader.js:703:12)
at Function.Module.runMain (internal/modules/cjs/loader.js:999:10)
at internal/main/run_main_module.js:17:11
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! chatbot-with-voice-activation-wake-word@1.0.0 start: `node ./run.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the chatbot-with-voice-activation-wake-word@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\diana\AppData\Roaming\npm-cache\_logs\2019-09- 16T13_56_28_690Z-debug.log
我在文档中创建了三个文件:
.env
具有凭证信息的文件package.json
和run.js
文件。
我无法弄清楚它无法访问read-credentials-file
存储为文件的.ts
文件。
请帮我。提前致谢。
解决方案
我认为您必须检查您创建的文件“.env”,并确保您根据您的服务凭证更新了凭证。
推荐阅读
- node.js - 将项目编译为静态网页,如 angular `ng build`
- java - 提交 Flink 作业时出现 java.lang.NoClassDefFoundError
- python - Python 3 元组迭代。错误或预期行为?
- android - 如何在 kotlin 中使用 intent.setComponent
- powershell - PowerShell,无法读取数据文件
- reactjs - 未能使用 jest 在我的反应应用程序中集成测试
- go - Golang 程序在 Windows 10 中给出不正确的结果
- javascript - 为什么视频聊天不能在 websockets 上运行?
- python - 根据特定条件将熊猫中的 2 个字符串列组合成一个新列的最佳方法是什么?
- ios - addTarget 不适用于 UICollectionViewCell 中的按钮