Have an issue that this page can’t solve? Get ahold of me and I’ll help you solve it. View the support page for more details and contact info.
Some people have had various issues when using Sharp. This is the library that Astro uses for image optimization. Here are some things to try that have worked for others.
If you see this error, it likely means astro-compress and astro are trying to use different versions of sharp. This seems to work fine on Windows, but not Linux. Here is the solution I have found - add the following to your
Other things you can try:
- Update your Node version
- I am currently running Node v20.10.0
- Try deleting
node_modulesand reinstalling dependencies with
- If Sharp is installed as a dependency, try removing it, deleting
node_modules, and reinstalling dependencies with
- If Sharp is not already installed as a dependency, try installing it with
npm install sharp
- Try installing sharp with
npm install sharp --ignore-engines