This is very simple to solve (i faced issue after update my node)
1 . check your node where it is install
2 . check where your node-gyp path comes from
step:1 (cmd or shell)
which node
output
/c/Program Files/nodejs/node
Tips: after i update my node-gyp path is changed ,now easy to track we already got path
C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node_gyp.js
now we are going to set right path
step:2
npm config list
now you can see node-gyp path
; cli configs
metrics-registry = "https://registry.npmjs.org/"
scope = ""
user-agent = "npm/6.12.0 node/v12.9.0 win32 ia32"
; userconfig C:\Users\balaji\.npmrc
init-author-name = "Balaji"
init-license = "MIT"
msvs_version = "2017"
node_gyp = "C:\\Users\\balaji\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js"
python = "C:\\Users\\balaji\\.windows-build-tools\\python27/python.exe"
; globalconfig C:\Users\balaji\AppData\Roaming\npm\etc\npmrc
; builtin config undefined
prefix = "C:\\Users\\balaji\\AppData\\Roaming\\npm"
; node bin location = C:\Program Files (x86)\nodejs\node.exe
; cwd = G:\all clients project\2020\anware
; HOME = C:\Users\balaji
; "npm config ls -l" to show all defaults.
Now time to change right path, Must Run in power shell
npm config set node_gyp /path/to/executable/node_gyp
Tips if all configuration right simply delete node_modules folder then run npm install in your node path