rsnext/errors/install-sharp.md
Steven b7daae418b
Update install-sharp.md (#18508)
Co-authored-by: Luis Alvarez D. <luis@vercel.com>
2020-10-30 10:56:11 -04:00

1 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).