35

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?

Penny Liu
  • 15,447
  • 5
  • 79
  • 98
zaki tutu
  • 595
  • 3
  • 7
  • 16

10 Answers10

41

I encountered the identical issue, however, the execution of this single command line successfully resolved the problem at hand.

npm rebuild --verbose sharp

Please refer to the installation documentation under Common problems for further guidance.

Penny Liu
  • 15,447
  • 5
  • 79
  • 98
  • 2
    This fixed `Error: Something went wrong installing the "sharp" module Cannot find module '../build/Release/sharp-darwin-arm64v8.node'` for me on moving from a Intel to arm based Mac. – dvdsmpsn Jun 28 '22 at 10:05
9

Find the latest version of sharp and install it.

npm install sharp@0.28.3 --save

This worked for me.

Peter Csala
  • 17,736
  • 16
  • 35
  • 75
DHIVAGAR M
  • 91
  • 1
  • 1
8

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.

Sanan Ali
  • 2,349
  • 1
  • 24
  • 34
3

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

npm install --ignore-scripts=false
dev-ton
  • 301
  • 1
  • 4
2

This causes after i updated, npm,angular version.

just try

npm i cordova-res

it solves above problem.

Vignesh PS
  • 21
  • 3
0

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

sekrett
  • 1,205
  • 1
  • 15
  • 17
0

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
Phaki
  • 210
  • 4
  • 18
0

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
0

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

Tomasz Waszczyk
  • 2,680
  • 5
  • 35
  • 73
-3

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)

colinux
  • 3,989
  • 2
  • 20
  • 19