Tuesday, June 4, 2024
 Popular · Latest · Hot · Upcoming
45
rated 0 times [  49] [ 4]  / answers: 1 / hits: 38214  / 9 Years ago, mon, july 27, 2015, 12:00:00

As my title explains I am getting the following error:



 {
errorMessage: Cannot find module 'index',
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)
]
}


I have tried both solutions provided in creating-a-lambda-function-in-aws-from-zip-file and simple-node-js-example-in-aws-lambda



My config currently looks like:enter



and my file structure is:
enter



and my index.js handler function looks like :



exports.handler = function(event, context) {


What else could be causing this issue aside from what was stated in those two answers above? I have tried both solutions and I have also allocated more memory to the function just incase thats why it couldn't run.



EDIT -
For the sake of trying, I created an even simpler version of my original code and it looked like this:



var Q = require('q');
var AWS = require('aws-sdk');
var validate = require('lambduh-validate');
var Lambda = new AWS.Lambda();
var S3 = new AWS.S3();




theHandler = function (event, context) {

console.log =('nothing');

}

exports.handler = theHandler();


And yet still does not work with the same error?


More From » node.js

 Answers
45

Try zipping and uploading the contents of the folder lambda-create-timelapse. Not the folder itself.


[#65652] Saturday, July 25, 2015, 9 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
jakobarmandr

Total Points: 363
Total Questions: 103
Total Answers: 87

Location: Romania
Member since Mon, Jun 6, 2022
2 Years ago
jakobarmandr questions
Thu, May 13, 21, 00:00, 3 Years ago
Thu, Aug 20, 20, 00:00, 4 Years ago
Thu, Jan 2, 20, 00:00, 5 Years ago
Mon, May 13, 19, 00:00, 5 Years ago
;