y-a-v-a / node-gd

🎨 GD graphics library (libgd) C++ bindings for Node.js.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Running on AWS Lambda

nikoskip opened this issue · comments

Hi,

I'm trying to run node-gd on Lambda but I'm getting this error:

2018-07-12 17:30:43.268 (-04:00) d428deda-861a-11e8-9036-57cbb0f6f30c /var/task/node_modules/node-gd/build/Release/node_gd.node: invalid ELF header
2018-07-12 17:30:43.269 (-04:00) d428deda-861a-11e8-9036-57cbb0f6f30c Cannot find module '/var/task/node_modules/node-gd/js/../build/default/node_gd.node'
2018-07-12 17:30:43.269 (-04:00) d428deda-861a-11e8-9036-57cbb0f6f30c Unable to find addon node_gd.node in build directory.

On my local I had to install gd and pkg-config using brew and it works as expected.

I found the same issue with node-canvas but they are supporting Lambda. It needs more steps, but nothing complicated: https://github.com/Automattic/node-canvas/wiki/Installation%3A-AWS-Lambda

It's possible to the same with node-gd?

Thanks

I answer myself: yes, it's possible! 👍

I went through the node-canvas guide and the only difference in this case is I needed to copy libgd.so.2 and libXpm.so.4 to my ./lib directory.

Hope this helps someone :)

Hi thanks for reaching out, sorry for my late reply. Nice that you've found out how to get node-gd running in AWS! I will see where and when I'm able to update the documentation with regard to AWS.
Regards,
Vincent

Hi @nikoskip,

I am facing library issue while executing code.
can you please provide which files needs to be copied.

regards,
Suren