New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
gonadn opened this Issue Aug 24, 2015 · 32 comments

Comments

Projects
None yet
@gonadn

gonadn commented Aug 24, 2015

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?

@bnoordhuis

This comment has been minimized.

Show comment
Hide comment
@bnoordhuis

bnoordhuis Aug 24, 2015

Member

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.

Member

bnoordhuis commented Aug 24, 2015

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.

@gonadn

This comment has been minimized.

Show comment
Hide comment
@gonadn

gonadn Aug 24, 2015

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 commented Aug 24, 2015

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

This comment has been minimized.

Show comment
Hide comment
@gonadn

gonadn Aug 24, 2015

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 commented Aug 24, 2015

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?

@bnoordhuis

This comment has been minimized.

Show comment
Hide comment
@bnoordhuis

bnoordhuis Aug 24, 2015

Member

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.

Member

bnoordhuis commented Aug 24, 2015

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.

@Fishrock123 Fishrock123 added the Windows label Aug 24, 2015

@gonadn

This comment has been minimized.

Show comment
Hide comment
@gonadn

gonadn Aug 25, 2015

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 commented Aug 25, 2015

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....

@TooTallNate

This comment has been minimized.

Show comment
Hide comment
@TooTallNate

TooTallNate Aug 25, 2015

Contributor

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.

Contributor

TooTallNate commented Aug 25, 2015

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.

@gonadn

This comment has been minimized.

Show comment
Hide comment
@gonadn

gonadn Aug 26, 2015

the solution in my case was to run this command:

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

gonadn commented Aug 26, 2015

the solution in my case was to run this command:

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

@shraddha22

This comment has been minimized.

Show comment
Hide comment
@shraddha22

shraddha22 Jan 14, 2016

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 commented Jan 14, 2016

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

@kala725

This comment has been minimized.

Show comment
Hide comment
@kala725

kala725 May 30, 2016

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 commented May 30, 2016

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

@waltdakind

This comment has been minimized.

Show comment
Hide comment
@waltdakind

waltdakind Jul 26, 2016

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 commented Jul 26, 2016

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?

@Steviey

This comment has been minimized.

Show comment
Hide comment
@Steviey

Steviey commented Oct 9, 2016

+1

@wzup

This comment has been minimized.

Show comment
Hide comment
@wzup

wzup commented Nov 16, 2016

+1

@h4ck4life

This comment has been minimized.

Show comment
Hide comment
@h4ck4life

h4ck4life commented Jan 18, 2017

+1

@lber19535

This comment has been minimized.

Show comment
Hide comment
@lber19535

lber19535 Jan 18, 2017

Just use VS developer command prompt if you have VS

lber19535 commented Jan 18, 2017

Just use VS developer command prompt if you have VS

@makiJS

This comment has been minimized.

Show comment
Hide comment
@makiJS

makiJS commented Jan 21, 2017

+1

@td4b

This comment has been minimized.

Show comment
Hide comment
@td4b

td4b commented Feb 16, 2017

+1

@Steviey

This comment has been minimized.

Show comment
Hide comment
@Steviey

Steviey Feb 16, 2017

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 commented Feb 16, 2017

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.

@a3zzat

This comment has been minimized.

Show comment
Hide comment
@a3zzat

a3zzat Mar 28, 2017

the same issue and no solution

a3zzat commented Mar 28, 2017

the same issue and no solution

@adamwallace

This comment has been minimized.

Show comment
Hide comment
@adamwallace

adamwallace Apr 28, 2017

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 commented Apr 28, 2017

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.

@SaiMounikaRao

This comment has been minimized.

Show comment
Hide comment
@SaiMounikaRao

SaiMounikaRao May 11, 2017

mounika$ node-gyp configure --msvs_version=2015
gyp info it worked if it ends with ok
gyp info using node-gyp@3.6.1
gyp info using node@7.4.0 | 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 commented May 11, 2017

mounika$ node-gyp configure --msvs_version=2015
gyp info it worked if it ends with ok
gyp info using node-gyp@3.6.1
gyp info using node@7.4.0 | 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?

@gibfahn

This comment has been minimized.

Show comment
Hide comment
@gibfahn

gibfahn May 11, 2017

Member

@SaiMounikaRao is there a binding.gyp file in your working directory (/Users/mounika/FULLClient-Electron-aw-lily)?

Also it looks like you're using a Mac, but --msvs_version=2015 is a Windows specific option.

Member

gibfahn commented May 11, 2017

@SaiMounikaRao is there a binding.gyp file in your working directory (/Users/mounika/FULLClient-Electron-aw-lily)?

Also it looks like you're using a Mac, but --msvs_version=2015 is a Windows specific option.

@SaiMounikaRao

This comment has been minimized.

Show comment
Hide comment
@SaiMounikaRao

SaiMounikaRao May 12, 2017

No binding.gyp is not present in my directory.

SaiMounikaRao commented May 12, 2017

No binding.gyp is not present in my directory.

@gibfahn

This comment has been minimized.

Show comment
Hide comment
@gibfahn

gibfahn May 12, 2017

Member

@SaiMounikaRao so what exactly are you trying to do? You should just be able to do npm install in /Users/mounika/FULLClient-Electron-aw-lily, I'm not sure why you're running node-gyp directly.

Member

gibfahn commented May 12, 2017

@SaiMounikaRao so what exactly are you trying to do? You should just be able to do npm install in /Users/mounika/FULLClient-Electron-aw-lily, I'm not sure why you're running node-gyp directly.

@SaiMounikaRao

This comment has been minimized.

Show comment
Hide comment
@SaiMounikaRao

SaiMounikaRao May 12, 2017

Ya I got it now it's working fine.
Actually I have already done with "npm install" in my directory after that when I am trying to run my code it's showing that error. So I have tried with different things and now my problem got solved.

SaiMounikaRao commented May 12, 2017

Ya I got it now it's working fine.
Actually I have already done with "npm install" in my directory after that when I am trying to run my code it's showing that error. So I have tried with different things and now my problem got solved.

@mailparikshit

This comment has been minimized.

Show comment
Hide comment
@mailparikshit

mailparikshit May 17, 2017

how did you resolved your problem??

mailparikshit commented May 17, 2017

how did you resolved your problem??

@refack

This comment has been minimized.

Show comment
Hide comment
@refack

refack May 17, 2017

Member

Suggested solutions that came up in this thread:

  1. Make sure you have a compiler set up - https://github.com/nodejs/node-gyp/#installation
  2. Make sure you have the latest npm - https://docs.npmjs.com/getting-started/installing-node
  3. sometimes node-gyp does not need to be run directly, running npm i will trigger it #702 (comment)

@mailparikshit what exactly is the problem you are seeing? You could open a new issue with the error out you got?

Member

refack commented May 17, 2017

Suggested solutions that came up in this thread:

  1. Make sure you have a compiler set up - https://github.com/nodejs/node-gyp/#installation
  2. Make sure you have the latest npm - https://docs.npmjs.com/getting-started/installing-node
  3. sometimes node-gyp does not need to be run directly, running npm i will trigger it #702 (comment)

@mailparikshit what exactly is the problem you are seeing? You could open a new issue with the error out you got?

@jeanru

This comment has been minimized.

Show comment
Hide comment
@jeanru

jeanru Sep 8, 2017

I create binding.gyp file manually under the path c:\users\leon\appdata\roaming\npm\node_modules\node-gyp with following content:
{
"targets": [
{
"target_name": "binding",
"sources": [ "build/Release/binding.node" ]
}
]
}.
After that, I run node-gyp rebuild command and the issue is solved.

jeanru commented Sep 8, 2017

I create binding.gyp file manually under the path c:\users\leon\appdata\roaming\npm\node_modules\node-gyp with following content:
{
"targets": [
{
"target_name": "binding",
"sources": [ "build/Release/binding.node" ]
}
]
}.
After that, I run node-gyp rebuild command and the issue is solved.

@odahcam

This comment has been minimized.

Show comment
Hide comment
@odahcam

odahcam Dec 15, 2017

I think we just shouldn't try to node-gyp rebuild, because, in most of cases, it will not solve any other issues.

odahcam commented Dec 15, 2017

I think we just shouldn't try to node-gyp rebuild, because, in most of cases, it will not solve any other issues.

@btoo

This comment has been minimized.

Show comment
Hide comment
@btoo

btoo Dec 30, 2017

im using the Windows Subsystem for Linux and i was able to fix my problem by doing sudo apt-get install g++

btoo commented Dec 30, 2017

im using the Windows Subsystem for Linux and i was able to fix my problem by doing sudo apt-get install g++

@AymaxLi

This comment has been minimized.

Show comment
Hide comment
@AymaxLi

AymaxLi May 15, 2018

@shraddha22 I got the same issue as you. have you solved it ? (;′⌒`)

AymaxLi commented May 15, 2018

@shraddha22 I got the same issue as you. have you solved it ? (;′⌒`)

@odahcam

This comment has been minimized.

Show comment
Hide comment
@odahcam

odahcam May 15, 2018

I was able to solve with npm install --global --production windows-build-tools available at https://www.npmjs.com/package/windows-build-tools.

Sometimes I needed to uninstall and reinstall some software for a fresh start, but everything works fine after the build tools instalation.

odahcam commented May 15, 2018

I was able to solve with npm install --global --production windows-build-tools available at https://www.npmjs.com/package/windows-build-tools.

Sometimes I needed to uninstall and reinstall some software for a fresh start, but everything works fine after the build tools instalation.

@mounir-m

This comment has been minimized.

Show comment
Hide comment
@mounir-m

mounir-m Jul 2, 2018

I've been running for the same issue for the past few days, here what you need to do :

I guess most people (it was my case) forget to simply add binding.gyp

Hope it helps ...

mounir-m commented Jul 2, 2018

I've been running for the same issue for the past few days, here what you need to do :

I guess most people (it was my case) forget to simply add binding.gyp

Hope it helps ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment