kelektiv / node.bcrypt.js

bcrypt for NodeJs
MIT License
7.38k stars 510 forks source link

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

Closed afraidjpg closed 12 months ago

afraidjpg commented 1 year ago

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 12 months ago

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