npm install with error: `gyp` failed with exit code: 1 npm install with error: `gyp` failed with exit code: 1 windows windows

npm install with error: `gyp` failed with exit code: 1


If this is a mac machine (OSX) here is what you can do

use terminal

xcode-select --print-path

then remove installed version

sudo rm -r -f /Library/Developer/CommandLineTools

and reinstall

xcode-select --install

that should fix the problem

Ref: gyp: No Xcode or CLT version detected macOS Catalina


this works for me. run command below one by one

rm -rf node_modulesrm package-lock.jsonnpm updatenpm install


Delete your $HOME/.node-gyp directory and try again:

rm -R ~/.node-gyp