use*_*327 5 javascript aws-lambda
我有一个简单的exports.js文件,我已压缩文件夹并将其上传到Lambda但在运行时它会出错:
"errorMessage": "Cannot find module 'exports'",
"errorType": "Error",
"stackTrace":
[
"Function.Module._resolveFilename (module.js:338:15)",
"Function.Module._load (module.js:280:25)",
"Module.require (module.js:364:17)",
"require (module.js:380:17)"
]
Run Code Online (Sandbox Code Playgroud)
任何帮助,将不胜感激.谢谢
小智 2
1.将文件命名为exports.js
2.在文件中将处理程序命名为exports.handler
exports.handler = function (event, context)
{
var YourSkill = new YourSkill();
YourSkill.execute(event, context);
}
Run Code Online (Sandbox Code Playgroud)
3.将lambda配置中的处理程序设置为exports.handler
4.仅压缩文件夹的内容,如果您也压缩文件夹,它将找不到您的文件。
5.重命名zip文件exports.zip
| 归档时间: |
|
| 查看次数: |
3234 次 |
| 最近记录: |