node.js - 在本地开发 Alexa 技能时 Dynamo 错误 "ConfigError: Missing region in config"

标签 node.js amazon-dynamodb aws-lambda alexa-skills-kit

使用 Bespoken Tools 在本地开发和调试 Alexa 技能时, 连接到 Dynamo 时发生错误(使用 Alexa Node.js SDK )。

错误发生在 "get" call to Dynamo 上的 Alexa SDK 中.

最佳答案

发生此错误是因为 ~/.aws/config 中设置的区域未被适用于 AWS 的 Node.js SDK 正确识别。

要解决这个问题,只需显式调用配置区域,如下所示:

AWS.config.update({
    region: "us-east-1"
});

请务必在使用 alexa-sdk 处理任何事件之前调用它,即在调用 alexa.execute() 之前。

关于node.js - 在本地开发 Alexa 技能时 Dynamo 错误 "ConfigError: Missing region in config",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43501436/

相关文章:

amazon-web-services - 如何检查 AWS STS 访问 token 是否有效

javascript - Node.js 中的异步循环

node.js - MongoError : Topology is closed, 请连接

javascript - 使用lodash将对象的嵌套数组排序出来

amazon-web-services - 如何在 AWS CloudFormationTemplate 中引用 Lambda 的 AWS GlobalSecondaryIndex 名称

json - 有没有办法从 CloudFormation 模板填充 Amazon DynamoDB 表?

amazon-dynamodb - DynamoDB 表的连续备份和 PITR 之间有什么区别?

aws-lambda - Lambda 链接 - 使用 terraform 从另一个 lambda 调用 lambda

javascript - node.js child_process.spawn 没有标准输出,除非 'inherit'

python - 使用 Python 在 Lambda 中处理 S3 桶触发事件