mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
1.0 KiB
1.0 KiB
Install sharp to Use Built-In Image Optimization
Why This Error Occurred
Using Next.js' built-in Image Optimization requires sharp as a dependency.
You are seeing this error because your OS was unable to install sharp properly, either using pre-built binaries or building from source.
Possible Ways to Fix It
Option 1: Use a different version of Node.js and try to install sharp again.
npm i sharp
# or
yarn add sharp
Option 2: If using macOS, ensure XCode Build Tools are installed and try to install sharp again.
For example, see macOS Catalina instructions.
Option 3: Use a different OS and try to install sharp again.
For example, if you're using Windows, try using WSL (Windows Subsystem for Linux).