PureDevOps Community

Bcrypt_lib.node: invalid ELF header

I have an graphql nodejs app and I am encountering the bcrypt_lib.node: invalid ELF header error while running this in the docker container

bcrypt compiled on OSX will not quite work on Linux. In other words, if you check in the bcrypt compiled on your local OSX workstation, and try to run the node app on your linux servers, you will see the error above.

Solution: npm install bcrypt on Linux, check that in, solved.

Probably the best way to deal with this is exclude your node_modules in .gitignore… and npm install remotely.