node-gyp icon indicating copy to clipboard operation
node-gyp copied to clipboard

node-gyp Error: Cannot find module

Open kakkero opened this issue 7 years ago • 5 comments

I have sorted more ways than i could do, e.g. uninstall everything and reinstalling it. but none works. Could someone please assist me on this one? Capture

C:\Windows\system32>node-gyp rebuild

C:\Windows\system32>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\....\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "" rebuild ) internal/modules/cjs/loader.js:584 throw err; ^

Error: Cannot find module 'C:\Program Files\nodejs\node_modules\npm\node_modules\node_modules\node-gyp\bin\node-gyp.js' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15) at Function.Module._load (internal/modules/cjs/loader.js:508:25) at Function.Module.runMain (internal/modules/cjs/loader.js:754:12) at startup (internal/bootstrap/node.js:283:19) at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)

kakkero avatar Apr 06 '19 03:04 kakkero

Hi, could you provide node and npm versions?

bzoz avatar Apr 11 '19 09:04 bzoz

Hi, could you provide node and npm versions?

image

kakkero avatar May 03 '19 07:05 kakkero

C:\Windows\System32>node-gyp rebuild gyp info it worked if it ends with ok gyp info using [email protected] gyp info using [email protected] | win32 | x64 gyp ERR! configure error gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable. gyp ERR! stack at PythonFinder.failNoPython (C:\Users\Administrator\AppData\Roaming\npm\node_modules\node-gyp\lib\configure.js:484:19) gyp ERR! stack at PythonFinder. (C:\Users\Administrator\AppData\Roaming\npm\node_modules\node-gyp\lib\configure.js:509:16) gyp ERR! stack at C:\Users\Administrator\AppData\Roaming\npm\node_modules\node-gyp\node_modules\graceful-fs\polyfills.js:282:31 gyp ERR! stack at FSReqWrap.oncomplete (fs.js:153:21) gyp ERR! System Windows_NT 10.0.10586 gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\Administrator\AppData\Roaming\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild" gyp ERR! cwd C:\Windows\System32 gyp ERR! node -v v10.15.3 gyp ERR! node-gyp -v v4.0.0 gyp ERR! not ok

kakkero avatar May 03 '19 07:05 kakkero

Make sure you have python 2 installed and that it's on your %PATH% somewhere. You can also pass --python <path>\python.exe to npm / node-gyp or set that in your .npmrc.

bnoordhuis avatar May 06 '19 07:05 bnoordhuis

see https://github.com/nodejs/node-gyp#on-windows if you need more info on dependencies and how to get them conveniently

rvagg avatar Jun 20 '19 02:06 rvagg