Closed atwoodjw closed 8 years ago
That's weird. We clearly define a name (npm
).
Here's a Gist for the handler.
The code is simple, but I'm running through Browserify.
function handler(event, context, cb) {
var conf = require('rc')('npm');
return cb(null, {
message: 'Your Lambda function executed successfully!'
});
}
exports.handler = handler;
I might not be following here but why are you using browserify for AWS Lambda? Lambda isn't a browser, it's just a service that executes your node app within a docker container.
Just write your code, zip everything and upload to lambda.
I'm using the Serverless framework with the Optimizer plugin. This isn't required, but reduces the file sizes of functions and purportedly decreases provisioning time.
I can setup an example function that doesn't use the Optimizer plugin if that's helpful.
Try it without the optimizer plugin first to make sure it's not a browserify issue.
Browserify does not support !module.parent, which rc
uses for a conditional log statement.
Please close.
I'm trying to use download within an AWS Lambda Handler, written in Node.js, but I'm seeing an error.
The following line seems to be the culprit.