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

安稳与你 提交于 2019-12-18 11:15:09

问题


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?


回答1:


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



回答2:


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.




回答3:


Rebuilding bycrypt from souce fixed the problem of mine

npm rebuild bcrypt --build-from-source


来源:https://stackoverflow.com/questions/29340510/bcrypt-is-breaking-my-meteor-application-how-do-i-fix-it

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!