40

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?

1
  • Can you give me the complete url of module in the error text to help you? I had a similar problem and I resolved it. Commented Jul 20, 2019 at 1:03

11 Answers 11

50

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.

2
  • 3
    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
    Commented Jun 28, 2022 at 10:05
  • 1
    Worked for me on Linux (running with Multipass on a M1 Mac)
    – Indika K
    Commented Feb 10 at 7:39
9

Find the latest version of sharp and install it.

npm install [email protected] --save

This worked for me.

0
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.

1
  • 1
    Yes... you might even need to do it more than once, which was my case.
    – d13
    Commented May 14, 2020 at 14:32
3

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

npm install --ignore-scripts=false
2

This causes after i updated, npm,angular version.

just try

npm i cordova-res

it solves above problem.

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

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
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.

0

If you're using Gatsby, it's good to check if updating all packages associated with sharp helps. I had this problem twice, and it helped

yarn add gatsby-plugin-sharp gatsby-plugin-manifest gatsby-transformer-sharp gatsby-transformer-sqip

Or

npm install gatsby-plugin-sharp gatsby-plugin-manifest gatsby-transformer-sharp gatsby-transformer-sqip

source: https://www.gatsbyjs.com/plugins/@lgenzelis/gatsby-plugin-sharp/#incompatible-library-version-sharpnode-requires-version-x-or-later-but-z-provides-version-y

-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)

2
  • 22
    What is the link between modules 'expo-cli' and 'sharp'? Commented Oct 12, 2019 at 19:54
  • 1
    @emeraldjava the question has an expo tag.
    – Dan
    Commented Oct 15, 2021 at 23:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.