Open redbugz opened 7 years ago
I tried to make it work with the same solution that the one provided by this repo, but I had the same problem when trying to install bcrypt
.
I did not want to use an EC2 instance and ended creating this docker image: https://github.com/myrmex-org/docker-lambda-packager https://hub.docker.com/r/myrmex/lambda-packager/
The solution may seem a little hacky but I managed to deploy a Lambda with a dependency to bcrypt
with the two node.js runtimes.
I was able to get around the deploy issues and get this deployed to Lambda using some of the code from the forks, but once it is deployed, I cannot get it to correctly compile a node-gyp module like contextify as an example.
Perhaps it is because I am using the new 4.3.2 Node.js runtime on Lambda and maybe they tightened down what it can do. First, npm and node-gyp both want to put files in your $HOME directory, which is not writeable in current Lambda, resulting in EROFS errors. So setting $HOME=/tmp seemed to fix that problem. Then it tried to actually compile something and now it can't find g++
make: g++: Command not found
and I haven't been able to find a way to get around that yet.I have an older instance deployed on the 0.10.46 Node.js runtime, and I get this error there:
which could probably be fixed by setting $HOME=/tmp, but that runtime is going away, so I don't really want to spend time getting it to work.
Has anyone gotten this approach to work, using Lambda to compile node_modules for Lambda? Or is EC2 really the only approach?