我尝试将webshot与aws lambda结合使用,但出现错误:
{
"errorMessage": "Cannot find module 'graceful-fs'",
"errorType": "Error",
"stackTrace": [
"Module.require (module.js:497:17)",
"require (internal/module.js:20:19)",
"Object.<anonymous> (/var/task/node-webshot-master/lib/webshot.js:2:10)",
"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)"
]
}
这是我的代码:
var webshot = require('./node-webshot-master/lib/webshot.js');
exports.handler = function(event, context, callback) {
webshot('google.com', 'google.png', function() {
});
};
我还提供了我的代码的屏幕截图。谁能帮助我找出我为什么出现此错误?