0

I'm creating an AWS lambda function with NodeJS which will call to an AWS RDS instance. To do this I'm using the 'MariaSql' module. The function executes perfectly from my local command line, but after zipping the file and uploading it to Lambda, I receive this error:

"errorMessage": "Module did not self-register.",
"errorType": "Error",
"stackTrace": [
"Object.Module._extensions..node (module.js:434:18)",
"Module.load (module.js:343:32)",
"Function.Module._load (module.js:300:12)",
"Module.require (module.js:353:17)",
"require (internal/module.js:12:17)",
"Object.<anonymous> (/var/task/node_modules/mariasql/lib/Client.js:13:11)",
"Module._compile (module.js:409:26)",
"Object.Module._extensions..js (module.js:416:10)",
"Module.load (module.js:343:32)"
]

I have built the program in EC2 and included an init: npm install in the package.json in the hopes that the module would reigster/be created. I've also tried deleting and re-installing node_modules as well as trying npm rebuild to no avail.

jones
  • 61
  • 7
  • Possible duplicate of [aws - "Unable to import module 'process': /var/task/numpy/core/multiarray.so: invalid ELF header"](http://stackoverflow.com/questions/34881240/aws-unable-to-import-module-process-var-task-numpy-core-multiarray-so-in) – Karen B Aug 22 '16 at 21:17
  • 1
    @KarenB That's what I had hoped! I spun up a linux EC2 instance and created the entire project from scratch in that environment. Tried zipping it up (both on the EC2 instance and downloaded onto my local storage) but still receive the same error – jones Aug 22 '16 at 21:36

0 Answers0