- 1 year ago
Sharp installs via npm on Windows 10 x64, but gatsby develop does not find procedure \sharp.node
If you have installed the sharp
package successfully via npm on Windows 10 x64, but encounter a "Procedure not found: \sharp.node" error when running gatsby develop
, it indicates a mismatch between the sharp
package and the underlying Node.js environment. This issue can often be resolved by following these steps:
Remove the
sharp
package: Uninstall thesharp
package from your project by running the following command in your project's root directory:shellnpm uninstall sharp
Clean the package cache: Clear the npm package cache to ensure a clean installation. Run the following command:
shellnpm cache clean --force
Install the correct version of
sharp
: Find the appropriate version of thesharp
package that matches your Node.js and Windows environment. You can use thesharp
compatibility chart (https://sharp.pixelplumbing.com/install#installation-notes) to determine the compatible version. For example, if you're using Node.js v14.x on Windows 10, you may need to install version 0.27.3:shellnpm install sharp@0.27.3
Adjust the version number based on your specific environment requirements.
Rebuild the
sharp
package: After installing the correct version ofsharp
, you may need to rebuild it to ensure it is compatible with your system. Run the following command:shellnpm rebuild sharp
Verify installation: Confirm that the
sharp
package is installed without any errors by running:shellnpm ls sharp
This command should display the installed version of
sharp
without any warning or error messages.
Once you have completed these steps, try running gatsby develop
again. The "Procedure not found" error should no longer occur, and the sharp
package should work as expected within your Gatsby project.
If the issue persists, you may want to consider checking the compatibility of your Gatsby project with the specific version of sharp
you are using, and ensure that all other dependencies and versions are properly aligned. Additionally, you can consult the Gatsby documentation or reach out to the Gatsby community for further assistance.