我正在尝试在Nodejs 6.10中部署lambda函数,我收到此错误:
Response:
{
"errorMessage": "Cannot find module 'cfn-response'",
"errorType": "Error",
"stackTrace": [
"Module.require (module.js:497:17)",
"require (internal/module.js:20:19)",
"Object. (/var/task/index.js:2:20)",
"Module._compile (module.js:570:32)",
"Object.Module._extensions..js (module.js:579:10)",
"Module.load (module.js:487:32)",
"tryModuleLoad (module.js:446:12)",
"Function.Module._load (module.js:438:3)"
]
}
Function Logs:
START RequestId: d1123bc9-1722-11e8-84a2-c9cba9c66de8 Version: $LATEST
Unable to import module 'index': Error
at Function.Module._load (module.js:417:25)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/var/task/index.js:2:20)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
END RequestId: d1123bc9-1722-11e8-84a2-c9cba9c66de8
REPORT RequestId: d1123bc9-1722-11e8-84a2-c9cba9c66de8 Duration: 87.34 ms Billed Duration: 100 ms Memory Size: 128 MB Max Memory Used: 32 MB
我正在使用Node.js 6.10版本进行此方法并进行内联代码编辑。
我正在尝试执行的代码:
var response = require('cfn-response');
exports.handler = function(event, context) {
var input = parseInt(event.ResourceProperties.Input);
var responseData = {Value: input * 5};
response.send(event, context, response.SUCCESS, responseData);
};
任何线索?