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>