Both Expo Optimize and Expo Publish fails due to wrong "sharp" version.

Both Expo Optimize and Expo Publish fails due to wrong “sharp” version.

Doing a npm install does not solve the problem.

Publishing works without Optimize option.

C:\Users\andym\ninja-app>expo optimize
This will overwrite the original assets.
Optimizing assets...
Optimizing ./assets/images/splash.png

Something went wrong installing the "sharp" module

The module '\\?\C:\Users\andym\AppData\Roaming\npm\node_modules\expo-cli\node_modules\sharp\build\Release\sharp.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 64. This version of Node.js requires
NODE_MODULE_VERSION 72. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).

- Ensure the version of Node.js used at install time matches that used at runtime
- Consult the installation documentation at https://sharp.pixelplumbing.com/en/stable/install/
- Search for this error at https://github.com/lovell/sharp/issues


C:\Users\andym\ninja-app>

I also encountered this issue and solved it by downgrading to node 10.16.3, then uninstalling and re-installing the expo-cli.

For me it started working again …not sure why.

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.