Besuch doch bitte auch unsere neue Website, jetzt hier.

Lambda: Unable to import module ‚exports‘: Error

Unable to import module 'exports': Error at Function.Module._resolveFilename (module.js:338:15) at Function.Module._load (module.js:280:25) at Module.require (module.js:364:17) at require (module.js:380:17)

Is a permission error:
chmod -R 777 node_modules

Else check your configuration->handler value in Lambda:
The module-name.export value in your function. For example, „index.handler“ would call exports.handler in index.js.

meaning your index.js needs the configuration „index.handler“ in the configuration->handler value in Lambda. And the actual code starts with:
exports.handler = function (event, context)

Please see also this post, its another thing you could run in.

0 comments… add one

Leave a Comment