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

Created on 3 Apr 2019  路  15Comments  路  Source: nodejs/node-gyp

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:Usersxxxx) 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,

All 15 comments

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

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 [email protected]
gyp info using [email protected] | win32 | x64
gyp info spawn C:Python27python.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:UsersxxxAppDataRoamingnpmnode_modulesnode-gyplibconfigure.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

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

The above error is the verbose of node-gyp configure

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?

No, the file is not there.

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

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.

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

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

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.

  • 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>" ]
    }]
}

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:UserswilliAppDataRoamingnpmnode_modulesnode-gyplibconfigure.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

@WilliamMega

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

cwd to the directory with the binding.gyp file.

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Yamakaky picture Yamakaky  路  3Comments

halkar picture halkar  路  4Comments

chen4393 picture chen4393  路  3Comments

lopezdp picture lopezdp  路  3Comments

swaj picture swaj  路  3Comments