Title
l

lastmjs

11/08/2017, 9:44 PM
I've got a developer how has node_modules installed on his mac, and once our functions are deployed we keep getting this error in one of our functions:
invalid ELF header
, from bcrypt. This is probably from the fact that the node_modules were installed and native code compiled on his Mac, is there a fix for this in progress?
a

agartha

11/08/2017, 9:47 PM
You can switch to bcryptjs (easy), or build on Linux (harder)
l

lastmjs

11/08/2017, 9:54 PM
Thank you very much, bcryptjs worked. Is there an issue for adding automatic building to the framework?
I know we talked about this before, I can't see the thread anymore though...
a

agartha

11/08/2017, 9:55 PM
No stupid Slack
You need a running Linux docker to build native modules for Linux, but that would mean always doing a clean
npm install
in Docker, before deploying, which will slow the deploy down a lot.
As it's only needed for native modules, it's easy to add that to a npm script in your project yourself.
It's not really easy if you don't have Docker installed, nor if your team hasn't dealt with Docker yet. Also it's just unnecessary complication for the end user. I can no longer just run graphcool deploy
And native modules are plentiful in my experience, this is going to continue to cause issues for people
NABI and WASM could help someday, but not yet
a

agartha

11/09/2017, 1:28 AM
I haven't come across any solution for compiling native modules other than Docker
👍 1
l

lastmjs

11/09/2017, 1:29 AM
I'm just suggesting that the framework should do it automatically on the user's machine or in graphcool's servers
a

agartha

11/09/2017, 1:29 AM
If you don't have Docker, it can't happen on the user machine
It could happen on the GC server
l

lastmjs

11/09/2017, 1:30 AM
Couldn't the framework install Docker as part of installation?
a

agartha

11/09/2017, 1:30 AM
Well, if you use the local environment, you already need Docker
l

lastmjs

11/09/2017, 1:30 AM
It could install it from source and hopefully do a local install scoped to your project
True
a

agartha

11/09/2017, 1:30 AM
I actually created an issue earlier, I linked it to yours
👍 1
My proposal was having Graphcool run their own cloud instance to do the building
However, if you are already running Docker, it's literally a one-liner...
👍 1
l

lastmjs

11/09/2017, 1:35 AM
I guess the biggest issue is that we haven't started using the local environment yet, once we do then yep
a

agartha

11/09/2017, 1:36 AM
Good point
A proper CI solution might also do the trick
👍 1