question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

alternate install instructions for AWS Lambda

See original GitHub issue

Instead of spinning up an EC2 instances, I used the Amazon Linux docker image locally

docker run -it amazonlinux:latest /bin/bash

Then on the docker image at the bash-4.2# prompt:

curl -sL https://rpm.nodesource.com/setup_6.x | bash -
yum install -y gcc-c++ nodejs-6.10.3
mkdir /var/task && cd /var/task
npm install sharp

Back on the host (in a separate terminal window), I copied node_modules to my project directory. (182008de1f47 is the CONTAINER ID from docker ps):

docker cp 182008de1f47:/var/task/node_modules .

Maybe these could be alternate install instructions in the AWS Lambda section of docs/install.md?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
hakansoncommented, Dec 6, 2017

Yes, https://github.com/awslabs/aws-sam-local even uses that docker-lambda image. It is on my list to look at as well.

0reactions
stephan-nordnes-eriksencommented, Aug 15, 2018

I am having some issue with this while using typescript and webpack. I do the docker-npm install, and that seems to do it’s thing, but I still get this issue when deploying to AWS lambda.

It says; [684] external "sharp" 42 bytes {0} [built] and Serverless: Packing external modules: sharp@^0.20.5.

Perhaps serverless-webpack is changing the binary somehow?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Best practices for working with AWS Lambda functions
See Deploy Java Lambda functions with .zip or JAR file archives for instructions. Minimize the complexity of your dependencies.
Read more >
AWS Lambda – FAQs
Q: What is AWS Lambda? AWS Lambda lets you run code without provisioning or managing servers. You pay only for the compute time...
Read more >
Lambda extensions - AWS Documentation
Learn how to use extensions with your AWS Lambda function. ... run as separate processes, you can write them in a different language...
Read more >
Getting started with Lambda - AWS Documentation
To get started with Lambda, use the Lambda console to create a function. In a few minutes, you can create a function, invoke...
Read more >
Lambda runtimes - AWS Documentation
To change the runtime, you can update your function's configuration. The runtime is paired with one of the Amazon Linux distributions. The underlying...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found