zaki tutu
zaki tutu

Reputation: 685

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

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?

Upvotes: 42

Views: 51093

Answers (11)

Tomasz Olek
Tomasz Olek

Reputation: 39

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

Upvotes: 0

Penny Liu
Penny Liu

Reputation: 17468

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.

Upvotes: 56

Tomasz Waszczyk
Tomasz Waszczyk

Reputation: 3159

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

Upvotes: 0

Vlad  Stack
Vlad Stack

Reputation: 1

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

Upvotes: 0

Phaki
Phaki

Reputation: 315

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

Upvotes: 1

DHIVAGAR M
DHIVAGAR M

Reputation: 101

Find the latest version of sharp and install it.

npm install [email protected] --save

This worked for me.

Upvotes: 10

Rajendra singh rana
Rajendra singh rana

Reputation: 461

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

Upvotes: 0

Sanan Ali
Sanan Ali

Reputation: 3436

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.

Upvotes: 8

Vignesh PS
Vignesh PS

Reputation: 21

This causes after i updated, npm,angular version.

just try

npm i cordova-res

it solves above problem.

Upvotes: 2

dev-ton
dev-ton

Reputation: 311

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

npm install --ignore-scripts=false

Upvotes: 3

colinux
colinux

Reputation: 4609

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)

Upvotes: -3

Related Questions