When i run "gatsby develop " Something went wrong installing the "sharp" module error is showing
Asked Answered
I

3

6

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 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 ⠋ load plugins

Ilse answered 20/2, 2020 at 9:51 Comment(2)
Can you run rm -rf node_modules and then npm install again?Exuviate
Clearing node_modules doesn't solve this problem. @ExuviateBrockington
I
8

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
Izaguirre answered 26/2, 2020 at 8:20 Comment(0)
C
0

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

Crosby answered 25/3, 2021 at 10:35 Comment(0)
N
0

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 😄

Nay answered 24/12, 2021 at 8:38 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.