Bcrypt: invalid ELF header with Docker and Sails.JS
In my package config I had
"bcrypt":"^0.8.0" and when I took out the
^ and changed it to
"bcrypt":"0.8.0" I was able to get everything running.
The issue was that it was trying to run bcrypt 0.8.5 and that was causing issues for some reason.
bcrypt and Docker bcrypt_lib.node: invalid ELF header
I have found that excluding the entire local
node_modules directory does not allow you to install npm packages and have your docker container track those changes in the container on the fly. In order to have other package changes tracked specify only the bcrypt directory in the container volume:
Invalid ELF header with node bcrypt on AWSBox
Not sure what the best answer might be but I did find some post mentioning something about x86 vs 64 bit issues. I deleted the mongoose-troop module and called npm install from within the awsbox console and that seemed to have done it. Not sure how that will work as far as deploying to awsbox though. Might not work
ERROR: /ng-app/node_modules/bcrypt/lib/binding/bcrypt_lib.node: invalid ELF header
This is mostly a guess. But your step 7 copies all the files in your current context to
/ng-app (including any
node_modules folder you might have). If this
node_modules folder contains binaries and they were installed on macOS or Windows then they would be the wrong architecture for the container (which would be Linux).
A simple fix for this particular case would be to exclude the
node_modules folder by adding it to your
.dockerignore file (https://docs.docker.com/engine/reference/builder/#dockerignore-file). This would prevent
node_modules from being copied to the resulting container and the
node_modules from the
npm install at step 4 would be used instead.
Invalid ELF Header on Production Server
I found the answer because I installed bcrypt on a Windows machine, but the production server is running Linux meant that it didn’t have the correct files to work with.
I fixed it by installing bcrypt on a Linux machine and then uploading it to the hosting server.
Delete a Column from a Delimited File in Linux
Linux 64 Command Line Parameters in Assembly
How to Automate Telnet Session Using Expect
Escaping Quotes When Using Ssh
Bash "Declare -A" Does Not Work on MACos
How to Split Mailbox into Single File Per Message
How to Execute an Local Script in Remote Server with Parameters
How to Send a Sequence of at Commands to a Serial Port in Bash
How to Get Cmake to Use the Default Compiler on System Path
Running a Script After Startx Automatically
How to Build a Linux Kernel Module So That It Is Compatible with All Kernel Releases
Pyqt5 Error "Pycapsule_Getpointer Called with Incorrect Name"
Generate Random Float Number in Given Specific Range of Numbers Using Bash
Error: Could Not Find Tiller' When Running 'Helm Version'
Concurrency of Posix Threads in Multiprocessor MAChine
How to Bake Credential into Docker Image for Git