errors/sharp-missing-in-production.mdx
The next/image component's default loader uses squoosh because it is quick to install and suitable for a development environment.
next start, it is strongly recommended you install sharp.You are seeing this error because Image Optimization in production mode (next start) was detected.
output: "standalone", you must install sharp.You are seeing this error because Image Optimization in standalone mode (output: "standalone") was detected.
sharp by running one of the following commands in your project directory:npm i sharp
yarn add sharp
pnpm add sharp
bun add sharp
Then, build your project with next build. Finally, restart the server with either next start for production mode or node .next/standalone/server.js for standalone mode.
sharp is already installed but can't be resolved, set the NEXT_SHARP_PATH environment variable such as export NEXT_SHARP_PATH=/tmp/node_modules/sharp. Then, build your project with next build. Finally, restart the server with either next start for production mode or node .next/standalone/server.js for standalone mode.Note: This is not necessary for Vercel deployments, since
sharpis installed automatically for you.