Trevor Allred
Trevor Allred

Reputation: 978

How can I use sharp on AWS Lambda with pnpm?

I'm trying to run a lambda function with sharp installed. Sharp has instructions to install on AWS Lambda, but they are specific to npm. Specifically it requires me to run this:

npm install --arch=x64 --platform=linux --libc=glibc sharp

pnpm doesn't explicitly support the arch and platform options however.

I'm developing on a Max but am using Seed.run for CI/CD.

So far I really like pnpm and seed and I don't want to change either one. Is there a way for pnpm to install the right library?

Upvotes: 3

Views: 1618

Answers (1)

Zoltan Kochan
Zoltan Kochan

Reputation: 7716

You can pass unknown options to pnpm by prefixing them with config:

pnpm install --config.arch=x64 --config.platform=linux --config.libc=glibc sharp

Upvotes: 3

Related Questions