How to fix Something went wrong installing the "sharp" module and Cannot find module '../build/Release/sharp.node' in expo

Viewed 36371

I tried to install expo after I executed the command exp start but I got:

Something went wrong installing the "sharp" module

Cannot find module '../build/Release/sharp.node'.

How can I fix this problem?

10 Answers

I had the same problem and this single line command did the trick.

npm rebuild --verbose sharp

Consult the installation documentation at Common problems.

I am not using expo but faced this issue in react native. All I did is "deleted node_modules/sharp" folder. run npm install. fixed the issue.

Find the latest version of sharp and install it.

npm install sharp@0.28.3 --save

This worked for me.

Maybe you configured npm to ignore installation scripts. In that case delete the sharp module and run:

npm install --ignore-scripts=false

This causes after i updated, npm,angular version.

just try

npm i cordova-res

it solves above problem.

I was facing same issue in mac when I update my developer tools using xcode-select install then node project stop working on local

  1. sudo rm -rf /usr/local/Cellar/python3.8
  2. sudo rm -rf /usr/local/Cellar/python3.9
  3. rm yarn.lock
  4. rm package-lock.json
  5. rm -rf node_modules
  6. brew upgrade
  7. yarn install

worked for me

If anyone has this problem and other solutions didn't solve it. Try to uninstall vips globally, it worked for me.

npm -g uninstall libvips
brew uninstall vips

Then:

yarn clean
yarn install
gatsby develop

if trying some quick command fixes don't work you can try rebuilding the node_modules.

Delete the whole node_modules folder and run npm install

npm install

Upgrading of gatsby-transformer-sharp helped me in my case.

You may need to completely reinstall expo-cli package.

yarn global remove expo-cli
yarn global add expo-cli

OR

npm uninstall expo-cli -g
npm install expo-cli -g

(If you don't have expo-cli installed globally, remove global / -f flags)

Related