Yarn Version: 1.13.0
Sharp module is present in node module folder but . it’s throwing error .
can anyone know what’s the problem.Please help me to solve .i tired many solution but unable to fix it.
Error :
[2022-03-08 22:22:50.208] debug: Server wasn’t able to start properly.
[2022-03-08 22:22:50.210] error: Could not load js config file D:\Mohsin-Work-Space\Gatsby Practice Source Code\yourProjectName\node_modules@strapi\plugin-upload\strapi-server.js:
Something went wrong installing the “sharp” module
The specified module could not be found.
\?\D:\Mohsin-Work-Space\Gatsby Practice Source Code\yourProjectName\node_modules\sharp\build\Release\sharp-win32-x64.node
Sharp is part of the upload module and what is creating images etc when doing it.
This is with node built on the host system. So you the installation process depends on your OS.
Identify your operating system. This guide assumes you’re either running Windows or macOS.
If you’re on Windows, you’ll need to install Build Tools from Microsoft. You can download it from this link: . Follow the prompts to install the necessary components.
If you’re on macOS, you can use brew to install vips. Open the Terminal app and run the command
brew install vips
Once you have the necessary tools installed, make sure you’re running Node 16 or 18. You can check your version by running the command “node -v” in your terminal. If you need to upgrade, you can download the latest version from the official Node.js website: Download | Node.js.
Please make sure you delete the following files after doing this.
I had the same error when I put my Strapi instance inside Docker container. I had to add this line /server/node_modules to the volumes section of docker compose configuration and it worked
On Alpine with Node 18 and python3.11, the issue is the dependency on sharp 0.32.0, which depends on prebuild ^11.0.4 which in turns depends on node-gyp ^6.0.1 which is incompatible with newer versions of python.
Sharp 0.32.6 brings prebuild ^12.0.0 and node-gyp ^9.4.0 solving the issue.
Downgrading to python3.10 (Alpine 3.18 → 3.17) did it for me.
On other environments it might be useful as well to drop down to python3.10.