I just deployed my first Meteor app, but ran into a pretty significant problem. When I tried to start my application, I get the following error:
/home/hiapp/bundle/programs/server/node_modules/fibers/future.js:173 throw(ex); ^ Error: /home/hiapp/bundle/programs/server/npm/npm-bcrypt/node_modules/bcrypt/build/Release/bcrypt_lib.node: invalid ELF header at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Module.require (module.js:364:17) at require (module.js:380:17) at bindings (/home/hiapp/bundle/programs/server/npm/npm-bcrypt/node_modules/bcrypt/node_modules/bindings/bindings.js:74:15) at Object.<anonymous> (/home/hiapp/bundle/programs/server/npm/npm-bcrypt/node_modules/bcrypt/bcrypt.js:1:97) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12)
In the course of some research, it seems that the problem is that bcrypt has specifics for the platform, and because my development refers to OS X 10.10, but my production server is on Ubuntu 14.04, thatβs the problem. My job was to run npm install bcrypt from the program / server folder and then copy it from programs/server/node_modules/bcrypt to programs/server/npm . It looks like a lot of manual steps.
I'm going to redeploy my application with some fixes, and I'm worried that I will have to follow the same steps again. Is there a better way to deploy the Meteor app where you are not facing this problem? My procedure currently:
- Run
meteor build - scp result tarball for my server (Digital Ocean)
- Explode tarball in application users home directory
- ADDED STEPS: recompile bcrypt and copy the directory as described above.
I assume that auto-update will be broken as soon as the server first loads the new libraries, which will explode in fiery glory. Would it be better to just clone the GIT repository on the server and make a line right from there, or can I use mup or any other tools to help smooth the deployment process?
source share