Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Something went wrong installing the 'sharp' module] when running expo optimize #1696

Closed
ZissiBa opened this issue May 12, 2019 · 5 comments
Closed

Comments

@ZissiBa
Copy link

ZissiBa commented May 12, 2019

Iam trying to run expo optimize, but always run into this error:

`Something went wrong installing the "sharp" module
Cannot find module '../build/Release/sharp.node'

At first, I checked if sharp even is installed but it wasn't. So I ran
npm install sharp --save

The module '..build/Release/sharp.node' exists now, but I still get the same error.
I tried uninstalling all my modules and rerun npm install, but still the same error.
My package.json:

{ "main": "node_modules/expo/AppEntry.js", "scripts": { "start": "expo start", "android": "expo start --android", "ios": "expo start --ios", "eject": "expo eject", "test": "node ./node_modules/jest/bin/jest.js --watchAll" }, "jest": { "preset": "jest-expo" }, "dependencies": { "@expo/samples": "2.1.1", "axios": "^0.18.0", "expo": "^32.0.0", "react": "16.5.0", "react-native": "https://github.com/expo/react-native/archive/sdk-32.0.0.tar.gz", "react-native-calendars": "^1.60.0", "react-native-elements": "^1.1.0", "react-native-htmlview": "^0.14.0", "react-native-map-link": "^2.4.0", "react-native-vector-icons": "^6.0.0", "react-navigation": "^3.0.9", "react-redux": "6.0.0", "redux": "^4.0.1", "redux-thunk": "^2.3.0", "sharp": "^0.22.1" }, "devDependencies": { "babel-preset-expo": "^5.0.0", "jest-expo": "^32.0.0" }, "private": true }

Is there anything I miss? Do there exist any problems with sharp and some of the packages I use?

@ZissiBa
Copy link
Author

ZissiBa commented May 12, 2019

Removing expo client and Node.js completely to then reinstall the latest versions solved my issue.

@ParAnton
Copy link

ParAnton commented May 28, 2019

npm uninstall expo-cli -g

and then

npm install expo-cli -g

solved this issue for me

@jmporchet
Copy link

just to save everyone a second or two of doubt:

npm uninstall expo-cli -g (an n was missing)

@Crypt0Graphic
Copy link

Crypt0Graphic commented Jun 19, 2019

I got similar error with cordova-res:

The module '/usr/local/lib/node_modules/cordova-res/node_modules/sharp/build/Release/sharp.node' was compiled against a different Node.js version using NODE_MODULE_VERSION 67. This version of Node.js requires ...

As you said, uninstall and install as globally worked:

npm uninstall -g cordova-res

npm i -g cordova-res

Thanks.

@Sohail-Ansari
Copy link

For Windows user commands are as followings:

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

Repository owner locked and limited conversation to collaborators Jun 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants