bcrypt is breaking my meteor application, how do I fix it?
Asked Answered
O

3

17

I wasn't sure if this should be a stackoverflow or serverfault question.

I installed Meteor's accounts-password module and it worked locally, but broke my app when deployed to the server. Here's the scoop:

I'm running the latest Meteor 1.0.5 locally on OSX (OS just fully updated) Building with --architecture os.linux.x86_64 Deploying to Ubuntu 14.04.2 LTS x86_64 (just updated) Running nodejs v0.12.1 (freshly built) Serving app with nginx v1.4.0

And still getting:

/home/secrethistory/bundle/programs/server/node_modules/fibers/future.js:245
                                            throw(ex);
                                                  ^
Error: Module did not self-register.
    at Error (native)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at bindings (/home/secrethistory/bundle/programs/server/npm/npm-bcrypt/node_modules/bcrypt/node_modules/bindings/bindings.js:74:15)
    at Object.<anonymous> (/home/secrethistory/bundle/programs/server/npm/npm-bcrypt/node_modules/bcrypt/bcrypt.js:3:35)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)

Any tips or places to look next?

Occipital answered 30/3, 2015 at 7:25 Comment(2)
I guess its the new Nodejs v0.12 is breaking the stuff. try downgrading the node and then tryApocarpous
I tried that. And it still didn't work. I went back by 5's all the way back to 0.10.1. Using nvm install 0.10.1Occipital
J
26

The bcrypt module is platform dependant (as fibers), so you need to remove the package after decompressing the bundle in your server:

rm -R path/to/bcrypt

then install it again:

npm install bcrypt
Jobye answered 30/3, 2015 at 13:33 Comment(5)
Yes, indeed. That did it. Thank you. In my install script, after I was able to add two additional lines: sudo rm -R ./npm/npm-bcrypt/node_modules/bcrypt; sudo npm install bcryptOccipital
I ran into a similar error with simplesmtp as well. Same solution here.Occipital
If it's still not working for you after re-installing bcrypt verify that your node-gyp is the right version by running node-gyp -v, and if it's out of date run npm update node-gyp -g and after that re-install bcrypt.Proportioned
This helped me on Meteor 1.2, now I'm trying to deploy a Meteor 1.3 app and the directory structure has changedLawler
This solution did work for me after some time of searching. The thing is that just npm install bcrypt somehow left it in the previous state. Only removing the directory did work.Aerodontia
E
1

As of Meteor 1.0.5 (and this also applies to the forthcoming 1.1), we have not yet gone through the full testing, validation, and QA process with Node 0.12. I would recommend sticking with Node 0.10 until that point. While it is likely that it will mostly work, it's possible that some core changes will be necessary, and as you've seen, binary packages built against the 0.10 ABI don't work with 0.12.

Extrusion answered 30/3, 2015 at 18:6 Comment(1)
All true, but some of us were running up against the unpleasant surprise of needing to update node.js when we updated to the new releases of meteor. Then when we updated, we ran into this problem. And using nvm to dial back to node 10.x still wasn't fixing it (since apparently the binaries had been changed). So a workaround was needed.Occipital
I
0

Rebuilding bycrypt from souce fixed the problem of mine

npm rebuild bcrypt --build-from-source
Incapable answered 2/1, 2019 at 10:28 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.