DEV Community

Surhid Amatya
Surhid Amatya

Posted on

Something went wrong installing the "sharp" module and Cannot find module '../build/Release/sharp.node' in react native

I tested the application developed using react native, all features were working fine. Went to sleep. Turned on the laptop the other day and started the application for testing.

All of sudden out of blue I encountered the identical issue stating
Something went wrong installing the "sharp" module and Cannot find module '../build/Release/sharp.node'

I was amazed what happened and I had never ever heard about anything called sharp in react native mobile application development.

I started the research and most of the issue were related to react or Next no-one faced it in react native. SO I started my research and fount this link related to sharp

TADA, the execution of this single command line successfully resolved the problem at hand.

npm rebuild --verbose sharp
Enter fullscreen mode Exit fullscreen mode

Please refer to the installation documentation for further guidance.

Sharp is an High performance Node.js image processing whose prebuilt binaries are automatically selected by package managers for the current OS platform and CPU architecture, where available.

The typical use case for this high speed Node-API module is to convert large images in common formats to smaller, web-friendly JPEG, PNG, WebP, GIF and AVIF images of varying dimensions.

It can be used with all JavaScript runtimes that provide support for Node-API v9, including Node.js >= 18.17.0, Deno and Bun.

Reference:

  1. https://sharp.pixelplumbing.com/

Top comments (0)