Md RashedM
BuildShip2y ago
3 replies
Md Rashed

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;
}


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
Was this page helpful?