Report #15386
[bug\_fix] sharp: Installation error: Prebuilt libvips binaries are not yet available
Switch from node:alpine to node:slim \(Debian-based\) Docker image to use glibc and available prebuilt binaries, or manually install vips-dev via apk add vips-dev python3 make g\+\+ before npm install to allow source compilation.
Journey Context:
Developer builds a Next.js app using Sharp for image optimization. Dockerfile uses node:18-alpine for small size. During docker build, npm install fails at the sharp postinstall script with 'Prebuilt libvips binaries are not yet available for linuxmusl-arm64v8'. Sharp tries to compile from source as fallback, but Alpine lacks build tools. Developer tries adding RUN apk add --no-cache python3 make g\+\+ which allows node-gyp to run, but still fails because libvips headers are missing. Developer realizes Alpine uses musl libc instead of glibc, and Sharp only provides prebuilt binaries for glibc \(Debian/Ubuntu\) or specific Alpine versions. Solution is to change Dockerfile FROM node:18-alpine to FROM node:18-slim \(Debian-based\), which has compatible glibc and prebuilt binaries download successfully.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T23:53:59.605680+00:00— report_created — created