Md Rashed
Md Rashed8mo ago

Getting error for resizing images

import sharp from 'sharp';
export default async function resizeImage({
imagePath
}) {
const resizedImagePath = ${process.env.BUCKET_FOLDER_PATH}/${Date.now()}_resized.png;
await sharp(${process.env.BUCKET_FOLDER_PATH}/${imagePath}).resize(40, 40).toFile(resizedImagePath);
return resizedImagePath;
}
import sharp from 'sharp';
export default async function resizeImage({
imagePath
}) {
const resizedImagePath = ${process.env.BUCKET_FOLDER_PATH}/${Date.now()}_resized.png;
await sharp(${process.env.BUCKET_FOLDER_PATH}/${imagePath}).resize(40, 40).toFile(resizedImagePath);
return resizedImagePath;
}
Error: Could not load the "sharp" module using the linuxmusl-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 --libc=musl --cpu=x64 sharp - Consult the installation documentation: See https://sharp.pixelplumbing.com/install
3 Replies
Harini
Harini8mo ago
was this a AI generated node on BuildShip?
Gaurav Chadha
Gaurav Chadha8mo ago
It seems that this library requires some additional dependencies to be installed to make it work. You can try with some other library, or use Replicate or Stability nodes for image processing?
Md Rashed
Md RashedOP8mo ago
Yes it is