gatsby develop success openly and validate gatsby-configs - 0.005 s error Something went wrong installing the "sharp" module The module '\?\D:\korero\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 79. Please try re-compiling or re-installing the module (for instance, using
npm rebuildornpm 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 ⠋ load plugins
- 3,925
- 5
- 31
- 54
- 71
- 1
- 5
-
Can you run `rm -rf node_modules` and then `npm install` again? – ksav Feb 20 '20 at 10:29
-
Clearing `node_modules` doesn't solve this problem. @ksav – karlosos Feb 22 '20 at 16:23
3 Answers
Looks like you have upgraded your NodeJS version? The sharp package was initially installed and built under a different node version as the error states.
Compiled against NODE_MODULE_VERSION = 64 (NodeJS 10.x) while your current NodeJS expects NODE_MODULE_VERSION = 79 which means you're using Node 13.
An easy fix would be to simply run:
npm rebuild
- 4,757
- 1
- 33
- 37
sudo rm -rf /usr/local/Cellar/python3.8 if it exists
sudo rm -rf /usr/local/Cellar/python3.9 if it exists
brew upgrade
remove any one if it exists:
rm -rf package-lock.json
rm -rf yarn.lock
rm -rf node_modules
Then yarn install
Worked for me
- 809
- 12
- 16
- 323
- 3
- 4
Try removing node_modules and package-lock.json and yarn.lock files and clearing cache (using yarn cache clean or npm cache clean --force.
lastly,
try updating your npm or node versions
npm install npm@latest -g
This worked for me
- 29
- 6