-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: Could not load the "sharp" module using the linux-x64 runtime on AWS Lambda #4001
Comments
Update: Following the execution of |
https://sharp.pixelplumbing.com/install#aws-lambda If you still require help, please open a new installation issue and answer all of the questions. |
I am seeing the same issue @tpamsler you mentioned that as the solution but, for me running the |
My result from |
I just ran |
@tpamsler if you run that on your local machine or otherwise if you can see what went into the lambda, do you see what hte binaries are in the node_modules. Going into the node_modules/@img I see |
Here is what I have in my node_modules/@img
```
sharp-darwin-arm64
sharp-libvips-darwin-arm64
sharp-libvips-linux-x64
sharp-libvips-linuxmusl-x64
sharp-linux-x64
sharp-linuxmusl-x64
```
…On Fri, Feb 23, 2024 at 6:59 AM Ed Olivares ***@***.***> wrote:
@tpamsler <https://github.com/tpamsler> if you run that on your local
machine or otherwise if you can see what went into the lambda, do you see
what hte binaries are in the node_modules. Going into the node_modules/
@img <https://github.com/img> I see sharp-darwin-x64
sharp-libvips-darwin-x64 but, I actually see the linux values:
***@***.***/sharp-libvips-linux-arm and others in my package-lock
file as I have run that same npm install targeted for linux
—
Reply to this email directly, view it on GitHub
<#4001 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ART4UNTLBJG2BGISTSHLPPTYVCVGVAVCNFSM6AAAAABDRUVOEGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNRRGQ4DKMJZGI>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@tpamsler Would you mind posting your package.json and/or package-lock.json file. I'm interested if there are any diffs between. I can get these linux binaries by doing a |
I hope this helps somebody: For me installing the packages manually was the only way to make it work on AWS, I am using Sharp v0.33.4, this it is probably not a good practice (as mentioned) but at least it works.
|
Possible bug
Is this a possible bug in a feature of sharp, unrelated to installation?
npm install sharp
completes without error.node -e "require('sharp')"
completes without error.If you cannot confirm both of these, please open an installation issue instead.
Are you using the latest version of sharp?
sharp
as reported bynpm view sharp dist-tags.latest
.If you cannot confirm this, please upgrade to the latest version and try again before opening an issue.
If you are using another package which depends on a version of
sharp
that is not the latest, please open an issue against that package instead.What is the output of running
npx envinfo --binaries --system --npmPackages=sharp --npmGlobalPackages=sharp
?Cannot run above command as it's executed on AWS Lambda nodejs20.x
What are the steps to reproduce?
Execute lambda on AWS Lambfda
What is the expected behaviour?
Lambda function should load "sharp" image library without arrores
Please provide a minimal, standalone code sample, without other dependencies, that demonstrates this problem
const sharp = require('sharp');
Please provide sample image(s) that help explain this problem
{
"errorType": "Error",
"errorMessage": "Could not load the "sharp" module using the linux-x64 runtime\nPossible solutions:\n- Ensure optional dependencies can be installed:\n npm install --include=optional sharp\n yarn add sharp --ignore-engines\n- Ensure your package manager supports multi-platform installation:\n See https://sharp.pixelplumbing.com/install#cross-platform\n- Add platform-specific dependencies:\n npm install --os=linux --cpu=x64 sharp\n- Consult the installation documentation:\n See https://sharp.pixelplumbing.com/install",
"trace": [
"Error: Could not load the "sharp" module using the linux-x64 runtime",
"Possible solutions:",
"- Ensure optional dependencies can be installed:",
" npm install --include=optional sharp",
" yarn add sharp --ignore-engines",
"- Ensure your package manager supports multi-platform installation:",
" See https://sharp.pixelplumbing.com/install#cross-platform",
"- Add platform-specific dependencies:",
" npm install --os=linux --cpu=x64 sharp",
"- Consult the installation documentation:",
" See https://sharp.pixelplumbing.com/install",
" at Object. (/var/task/node_modules/sharp/lib/sharp.js:114:9)",
" at Module._compile (node:internal/modules/cjs/loader:1376:14)",
" at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)",
" at Module.load (node:internal/modules/cjs/loader:1207:32)",
" at Module._load (node:internal/modules/cjs/loader:1023:12)",
" at Module.require (node:internal/modules/cjs/loader:1235:19)",
" at require (node:internal/modules/helpers:176:18)",
" at Object. (/var/task/node_modules/sharp/lib/constructor.js:10:1)",
" at Module._compile (node:internal/modules/cjs/loader:1376:14)",
" at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)"
]
}
The text was updated successfully, but these errors were encountered: