kelektiv/node.bcrypt.js

Error: /var/user/node_modules/bcrypt/lib/binding/napi-v3/bcrypt_lib.node: invalid ELF header

afraidjpg opened this issue · 1 comments

I found the same issue about this question, but I still need some help for that.

I already know it's due to different platforms, I build the project on macOS and then upload it to server.
But the status quo is that I can't change this build flow. the project works on serverless. I must build the project on my local machine. So is there some way that I can install this package on my local machine that could work on server(linux)?

bcrypt version:

    "@types/bcrypt": "^5.0.0",
    "bcrypt": "^5.1.0"
recrsn commented

You can build your code inside a docker container from AWS https://docs.aws.amazon.com/lambda/latest/dg/nodejs-image.html#nodejs-image-instructions

If you are using Serverless, you can include it in the docker builder section