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

binding.gyp not found (cwd: c:\Users\xxxx\xxxx\) while trying to load binding.gyp

Open gonadn opened this issue 11 years ago • 49 comments

Hi

Iam having trouble to configure "node-gyp", I followed this article "https://github.com/nodejs/node-gyp" for installation of "node-gyp", and it was working before i messed up my configuration on my computer, node-gyp just stop working. By searching on google i found different explanations, but nothing fixed my issue.

Below is screenshot of when i Run the command "node-gyp configure" I hope that the path to root directory is correct?

node

By searching on google i found out that if i put an empety binding.gyp file in folder where iam running the command to configure node-gyp , then something start happening, but then i get another error to . So something is maybe missing here or i have done something i cant figure out...

I have installed VS2012 Express and VS2015 PRO, i also have run the npm command to set python and npm to --msvs_version=auto

Any clue on how to configure node-gyp on windows 8.1?

gonadn avatar Aug 24 '15 14:08 gonadn

What exactly are you trying to do? node-gyp is for building add-ons. From your screenshot, it looks like you're trying to build node-gyp itself.

bnoordhuis avatar Aug 24 '15 14:08 bnoordhuis

oki, iam trying to install bcrypt, when i first tried to install bcrypt i got an error saying that i need to run node-gyp rebuild, and thats where all started... I need to install Bcrypt...

And i have done all the installation steps described:

I need to install bcrypt...

gonadn avatar Aug 24 '15 15:08 gonadn

bnoordhuis , Where shoud i run this command from? in witch directory?

In installation describtions they say that you need to run the command from the root directory of you node.....what does it mean?

gonadn avatar Aug 24 '15 15:08 gonadn

node-gyp is installed along with npm, there should be no need to install it separately. If you get an error when you npm install bcrypt, you should take that up with the bcrypt project first.

bnoordhuis avatar Aug 24 '15 19:08 bnoordhuis

I no that, problom is when i try to install bcrypt i get an error saying that i have to run "node-gyp configure" before installing the bcrypt. And when i run node-gyp configure, i get another error saying that node-gyp cannot find the binding.gyp file......!! And i cant find any binding.gyp file in the root of directory....

gonadn avatar Aug 25 '15 21:08 gonadn

You should not need to run node-gyp configure manually. This happens implicitly when npm install bcrypt is run.

Closing since not a node-gyp issue.

TooTallNate avatar Aug 25 '15 22:08 TooTallNate

the solution in my case was to run this command:

set PATH=C:\Program Files (x86)\MSBuild\14.0\Bin;%PATH%

gonadn avatar Aug 26 '15 07:08 gonadn

I am getting the same issue. I tried a lot but couldnt fix this issue. Setting Path with MSBuild is also not working for e. I am getting this issue when I am trying to install ursa module. Also, i am using VS2012 Express.Please help npm install

shraddha22 avatar Jan 14 '16 06:01 shraddha22

Try running the following commands and then run npm install, this will take the node's default node-gyp module. (No need to have multiple as node package already provides that)

Updating the node & NPM

sudo npm cache clean -f sudo npm install -g n sudo n 4.4.5 sudo npm install npm -g

Removing additional Node-gyp module

sudo npm uninstall node-gyp -g sudo npm uninstall node-gyp

kala725 avatar May 30 '16 12:05 kala725

I am running into the same problem, the sudo commands are not applicable to a windows environment (and the npm package 'n' is not either). I get the same binding.gyp, and that's after successfully reinstalling node-gyp using the msvs_version. Elsewhere I've seen suggestions to reinstall Python. Anyone have other ideas?

waltdakind avatar Jul 26 '16 03:07 waltdakind

+1

Steviey avatar Oct 09 '16 12:10 Steviey

+1

wzup avatar Nov 16 '16 19:11 wzup

+1

h4ck4life avatar Jan 18 '17 08:01 h4ck4life

Just use VS developer command prompt if you have VS

lber19535 avatar Jan 18 '17 09:01 lber19535

+1

makiJS avatar Jan 21 '17 18:01 makiJS

+1

td4b avatar Feb 16 '17 04:02 td4b

I fixed it somehow after two weeks or so. It was a hell of trial and error. The process was so complex, that at the end I wasn't sure what fixed it. Gyp is an illness. Good luck!

Personal possible fix reasons on Win 7 from my notes (without any warranty):

  • C++ Build Tools + Win 8 SDK + Win 10 SDK
  • Env Vars: GYP_MSVS_VERSION = 2015
  • VS140COMNTOOLS = C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools
    Path = %ProgramFiles%\MSBuild\14.0\Bin;[...]
  • latest Python 2.x
  • reboot
  • I also did something under /node_modules/ for specific appliances like Electron, SQlite etc.

PS: Possibly the worst error traps (with tons of side effects), I've ever seen in my developer career. We all should know who did this crappy shit to us. And why the hell this issue is still closed and not fixed in general.

Trial and error belongs to machine learning, not to essential developer tools used by humans.

Steviey avatar Feb 16 '17 04:02 Steviey

the same issue and no solution

a3zzat avatar Mar 28 '17 20:03 a3zzat

I feel pretty silly, but I realized that I didn't have Visual C++ 2015 Build Tools and Visual Studio with Common Build tools (or relevant C++ addons). I installed both of those and didn't have this problem anymore.

adamwallace avatar Apr 28 '17 21:04 adamwallace

mounika$ node-gyp configure --msvs_version=2015
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | darwin | x64
gyp info spawn /usr/bin/python
gyp info spawn args [ '/usr/local/lib/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/mounika/FULLClient-Electron-aw-lily/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/usr/local/lib/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/mounika/.node-gyp/7.4.0/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/Users/mounika/.node-gyp/7.4.0',
gyp info spawn args   '-Dnode_gyp_dir=/usr/local/lib/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=node.lib',
gyp info spawn args   '-Dmodule_root_dir=/Users/mounika/FULLClient-Electron-aw-lily',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.' ]
gyp: binding.gyp not found (cwd: /Users/mounika/FULLClient-Electron-aw-lily) while trying to load binding.gyp
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/local/lib/node_modules/node-gyp/lib/configure.js:336:16)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Darwin 16.5.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/bin/node-gyp" "configure" "--msvs_version=2015"
gyp ERR! cwd /Users/mounika/FULLClient-Electron-aw-lily
gyp ERR! node -v v7.4.0
gyp ERR! node-gyp -v v3.6.1
gyp ERR! not ok 

Can anyone help me to solve this error?

SaiMounikaRao avatar May 11 '17 16:05 SaiMounikaRao