Skip to content

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

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

Closed
ewallteam opened this issue Apr 3, 2019 · 17 comments
Labels

Comments

@ewallteam
Copy link

Hi,

I have followed the below steps to install PWA.

https://magento-research.github.io/pwa-studio/venia-pwa-concept/setup/

But when trying to install build tools and configure the python dependency, we are facing this issue in windows 10.
gyp: binding.gyp not found (cwd: C:\Users\xxxx) while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: gyp failed with exit code: 1

And also we have tried the same steps in ubuntu system and it results the following error.

make: *** No targets specified and no makefile found. Stop.

So, kindly let us know how to fix this.

Thanks,

@bzoz
Copy link
Contributor

bzoz commented Apr 4, 2019

What command are you using to install build tools? Can you provide full verbose log?

@ewallteam
Copy link
Author

Thanks for the reply.

I have followed the steps from this link.
https://github.com/nodejs/node-gyp#installation

  1. npm install -g node-gyp
  2. My system is windows, so I have used option 1 - npm install --global --production windows-build-tools
  3. npm install --global --production windows-build-tools
  4. For configuring python dependency node-gyp --python /path/to/python2.7 - (/path/to/python2.7 - I have changed this to the location of python in my system).
  5. npm config set python /path/to/executable/python2.7 - (/path/to/executable/python2.7 - I have changed this to the location of python in my system)
  6. Then node-gyp configure

After that the below error occurs.

gyp info it worked if it ends with ok
gyp info using node-gyp@3.8.0
gyp info using node@10.15.3 | win32 | x64
gyp info spawn C:\Python27\python.exe
gyp info spawn args [ 'C:\Users\xxx\AppData\Roaming\npm\node_modules\node-gyp\gyp\gyp_main.py',
gyp info spawn args 'binding.gyp',
gyp info spawn args '-f',
gyp info spawn args 'msvs',
gyp info spawn args '-G',
gyp info spawn args 'msvs_version=auto',
gyp info spawn args '-I',
gyp info spawn args 'D:\PWA\build\config.gypi',
gyp info spawn args '-I',
gyp info spawn args 'C:\Users\xxx\AppData\Roaming\npm\node_modules\node-gyp\addon.gypi',
gyp info spawn args '-I',
gyp info spawn args 'C:\Users\xxx\.node-gyp\10.15.3\include\node\common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=C:\Users\xxx\.node-gyp\10.15.3',
gyp info spawn args '-Dnode_gyp_dir=C:\Users\xxx\AppData\Roaming\npm\node_modules\node-gyp',
gyp info spawn args '-Dnode_lib_file=C:\Users\xxx\.node-gyp\10.15.3\<(target_arch)\node.lib',
gyp info spawn args '-Dmodule_root_dir=D:\PWA\',
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 'D:\PWA\build',
gyp info spawn args '-Goutput_dir=.' ]
gyp: binding.gyp not found (cwd: D:\PWA) 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 (C:\Users\xxx\AppData\Roaming\npm\node_modules\node-gyp\lib\configure.js:345:16)
gyp ERR! stack at ChildProcess.emit (events.js:189:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\xxx\AppData\Roaming\npm\node_modules\node-gyp\bin\node-gyp.js" "configure"
gyp ERR! cwd D:\PWA
gyp ERR! node -v v10.15.3
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok

@bzoz
Copy link
Contributor

bzoz commented Apr 4, 2019

Could you provide output of node-gyp configure --verbose

@ewallteam
Copy link
Author

The above error is the verbose of node-gyp configure

@bzoz
Copy link
Contributor

bzoz commented Apr 4, 2019

Right, sorry.

So, the error message is gyp: binding.gyp not found (cwd: D:\PWA) while trying to load binding.gyp. Is the binding.gyp file there?

@ewallteam
Copy link
Author

No, the file is not there.

@alxmrs
Copy link

alxmrs commented May 29, 2019

@bzoz I'm having a similar issue. Will it help to share my configuration as well?

@bzoz
Copy link
Contributor

bzoz commented May 30, 2019

If the file is not there, then this is not an issue with node-gyp, but with the whatever project you are trying to build. You should report it to the package authors.

@Tenodec
Copy link

Tenodec commented Jun 13, 2019

for example,cd node_modules/ffi,then node-gyp rebuild

@rvagg
Copy link
Member

rvagg commented Jun 21, 2019

I'm going to close this due to staleness but as the above comment says, the node-gyp rebuild --verbose output should be generated within the directory of the addon that's failing. The above output has gyp: binding.gyp not found (cwd: D:\PWA) while trying to load binding.gyp -- if you are creating an addon inside D:\PWA then this simply means you need to create an appropriate binding.gyp in there. IF you are having trouble building a dependency addon, cd into node_modules\whateveraddon and do the node-gyp rebuild in there. There should be a binding.gyp in that directory, or it's not a proper addon and maybe this isn't node-gyp's problem.

@rvagg rvagg closed this as completed Jun 21, 2019
@jdmarshall
Copy link

I'm seeing node-gyp fail for hashring and node-syslog when trying to run yarn install. Same project, different directory, has no problems with npm install. I wonder if this is node-gyp or yarn.

@ghost
Copy link

ghost commented Mar 25, 2020

  • Try to resolve the missing file issue first:
  • gyp: binding.gyp not found (cwd: D:\PWA) while trying to load binding.gyp
  • Create the file manually 'binding.gyp' and add this content to it:
  • Change the path for the source Mac OS's normally goes in ( /usr/local/bin/node )
{
    "targets": [{
        "target_name": "binding",
        "sources": [ "<PATH TO NODE>" ]
    }]
}

@WilliamMega
Copy link

I have the same problem, could someone help me?

gyp info spawn args 'C:\build',
gyp info spawn args '-Goutput_dir=.'
gyp info spawn args ]
gyp: binding.gyp not found (cwd: C:) 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 (C:\Users\willi\AppData\Roaming\npm\node_modules\node-gyp\lib\configure.js:350:16)
gyp ERR! stack at ChildProcess.emit (events.js:315:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Windows_NT 10.0.18363
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\willi\AppData\Roaming\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild" "--verbose"
gyp ERR! cwd C:
gyp ERR! node -v v12.18.1
gyp ERR! node-gyp -v v7.0.0
gyp ERR! not ok

@bzoz
Copy link
Contributor

bzoz commented Jul 23, 2020

@WilliamMega

gyp: binding.gyp not found (cwd: C:) while trying to load binding.gyp

cwd to the directory with the binding.gyp file.

@osahady
Copy link

osahady commented Sep 16, 2020

same issue! Any suggestion?
gyp: binding.gyp not found (cwd: C:\node_modules) while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: gyp failed with exit code: 1

@kuro-kuma
Copy link

  • Try to resolve the missing file issue first:
  • gyp: binding.gyp not found (cwd: D:\PWA) while trying to load binding.gyp
  • Create the file manually 'binding.gyp' and add this content to it:
  • Change the path for the source Mac OS's normally goes in ( /usr/local/bin/node )
{
    "targets": [{
        "target_name": "binding",
        "sources": [ "<PATH TO NODE>" ]
    }]
}

you are right! thanks!

@shubhamrk2
Copy link

  • Try to resolve the missing file issue first:
  • gyp: binding.gyp not found (cwd: D:\PWA) while trying to load binding.gyp
  • Create the file manually 'binding.gyp' and add this content to it:
  • Change the path for the source Mac OS's normally goes in ( /usr/local/bin/node )
{
    "targets": [{
        "target_name": "binding",
        "sources": [ "<PATH TO NODE>" ]
    }]
}

where to find the path in windows, please help

@nodejs nodejs locked as resolved and limited conversation to collaborators Mar 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests