Thanks for reporting a new issue with the node bcrypt module!
To help you resolve your issue faster please make sure you have done the following:
Once you have done the above and are still confident that the issue is with the module, please describe it below. Some things that really help get your issue resolved faster are:
When using bcrypt, received an error:
Tue Apr 18 08:51:22 UTC 2017 : Endpoint response body before transformations: {"errorMessage":"/var/task/node_modules/bcrypt/lib/binding/bcrypt_lib.node: invalid ELF header","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/bcrypt/bcrypt.js:6:16)","Module._compile (module.js:409:26)","Object.Module._extensions..js (module.js:416:10)","Module.load (module.js:343:32)"]}
Not have this error, hash the password.
There is some information on native modules for AWS Lambda here: https://aws.amazon.com/blogs/compute/nodejs-packages-in-lambda/. However, I am unsure on what steps I would need to take to build bcrypt to make it work. Any guidance would be much appreciated.
4.3, AWS Lambda
Thanks!
P.S. If it doesn't look like you read the above then your issue will likely be closed without further explanation. Sorry, but there are just too many issues opened with no useful information or questions which have been previously addressed.
You have to compile the module in an Amazon Linux instance first, using the same version of NodeJS as available in lambda, then zip the directory and deploy.
Instructions for Amazon Linux:
https://github.com/kelektiv/node.bcrypt.js/wiki/Installation-Instructions#rhel-and-centos
An alternative is to use bcryptjs, with zero dependencies and still compatible with C++ bcrypt.
Hi, I'm stuck in a problem with bcryptjs, maybe you could share some light in this dark tunnel...
My post with the issue: https://github.com/kelektiv/node.bcrypt.js/issues/75
Thx in advance!!
Same problem here.
The answer to spin up an amazon linux docker image or an ec2 instance just to compile the library with the same NodeJS version and the blood of a virgin then move it back to your local repository, and include it in the bundled zipfile sounds too crazy to me.
The other bcrypt library worked for me
Most helpful comment
An alternative is to use bcryptjs, with zero dependencies and still compatible with C++ bcrypt.