当我在 Lambda 内联代码编辑器上测试代码时,我总是收到此错误:
"errorMessage": "RequestId: b8efba3e-8940-11e7-a176-e7452208b749 Process exited before completing request"
这是代码(我用亚马逊示例表单替换了我的代码,只是为了看看这是否只是我的代码):
'use strict';
var Alexa = require("aws-sdk");
exports.handler = function(event, context, callback) {
var alexa = Alexa.handler(event, context);
alexa.registerHandlers(handlers);
alexa.execute();
};
var handlers = {
'LaunchRequest': function () {
this.emit('SayHello');
},
'HelloWorldIntent': function () {
this.emit('SayHello');
},
'SayHello': function () {
this.emit(':tell', 'Hello World!');
}
};
最佳答案
请检查您的 Lambda 函数配置。默认情况下处理程序名称应为“index.handler”。如果不完全相同,请相应更改。如果您要上传 .zip 文件,请确保您的主处理函数应位于 index.js 文件中。请参阅随附的屏幕截图,其中我标记了更改处理程序配置的位置。
关于node.js - 我收到 "error message: Process exited before completing request",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45873814/