Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: /User/node_modules/farmhash/build/Release/farmhash.node: invalid ELF header #21

Closed
yasharma opened this issue Jun 19, 2018 · 3 comments
Labels

Comments

@yasharma
Copy link

yasharma commented Jun 19, 2018

I am following this script node-cluster-socket and getting this error

Error: /User/node_modules/farmhash/build/Release/farmhash.node: invalid ELF header
    at Object.Module._extensions..node (module.js:678:18)
    at Module.load (module.js:561:32)
    at tryModuleLoad (module.js:501:12)
    at Function.Module._load (module.js:493:3)
    at Module.require (module.js:593:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/User/node_modules/farmhash/index.js:3:18)
    at Module._compile (module.js:649:30)
    at Module._extensions..js (module.js:660:10)
    at Object.require.extensions.(anonymous function) [as .js] (/User/node_modules/babel-register/lib/node.js:152:7)

application running in docker container as

docker run                  \
    --rm                    \
    --name=xxxx-quiz       \
    --env "APP_HOST=localhost" \
    --env "APP_PORT=8086" \
    --network=xxxx   \
    -v ${PWD}:/xxxx \
    -w "/quiz"  \
    -p 8086:8086            \
    node:9.8.0 \
    npm run dev

i even tried to build the container with Dockerfile and then run, however getting the same error

@lovell
Copy link
Owner

lovell commented Jun 19, 2018

Hello, you'll need to run npm install on the same platform as used at runtime. (In this example it looks like npm install was run on OS X but Debian is being used at runtime.)

@yasharma
Copy link
Author

@lovell I've tried that as well, running npm install during docker image build, still getting the same error

@lovell
Copy link
Owner

lovell commented Jun 20, 2018

Make sure the node_modules directory generated on OS X is not copied into the Linux container.

@lovell lovell closed this as completed Jun 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants