keithwhor / nodal

API Services Made Easy With Node.js

Home Page:http://www.nodaljs.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

bcrpyt error when deploying to poly

scott-riley opened this issue · comments

Setting up a new polybit project and deploying gives the following error when I try to access the API server:

Application Error: /var/task/node_modules/bcrypt/build/Release/bcrypt_lib.node: invalid ELF header

Followed the deployment instructions:
nodal poly:new project-name
nodal poly:compile project-name

Poly reports a success back on the CLI but accessing the server throws the above error.

Cheers!
~ Scott

Uninstall bcrypt and install bcryptjs. Replace require('bcrypt') with require('bcryptjs') in your User model.

Should fix the problem. Polybit deploy / compile doesn't currently have an npm install step, meaning it's going to copy natively from your installed node_modules. Native JS modules only. It won't be this way forever, but for now the quick fix is what I've mentioned. :)

Ahh cool, I’ll give this a try today and post back results!

Everything cool? Mind if I close this?