Skip to content

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

Closed
@ewallteam

Description

@ewallteam

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,

Activity

bzoz

bzoz commented on Apr 4, 2019

@bzoz
Contributor

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

ewallteam

ewallteam commented on Apr 4, 2019

@ewallteam
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

bzoz commented on Apr 4, 2019

@bzoz
Contributor

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

ewallteam

ewallteam commented on Apr 4, 2019

@ewallteam
Author

The above error is the verbose of node-gyp configure

bzoz

bzoz commented on Apr 4, 2019

@bzoz
Contributor

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

ewallteam commented on Apr 4, 2019

@ewallteam
Author

No, the file is not there.

alxmrs

alxmrs commented on May 29, 2019

@alxmrs

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

bzoz

bzoz commented on May 30, 2019

@bzoz
Contributor

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

Tenodec commented on Jun 13, 2019

@Tenodec

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

rvagg

rvagg commented on Jun 21, 2019

@rvagg
Member

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.

jdmarshall

jdmarshall commented on Jan 2, 2020

@jdmarshall

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

ghost commented on Mar 25, 2020

@ghost
  • 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

WilliamMega commented on Jul 22, 2020

@WilliamMega

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

bzoz commented on Jul 23, 2020

@bzoz
Contributor

@WilliamMega

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

cwd to the directory with the binding.gyp file.

osahady

osahady commented on Sep 16, 2020

@osahady

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

kuro-kuma commented on Aug 26, 2021

@kuro-kuma
  • 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

shubhamrk2 commented on Mar 28, 2022

@shubhamrk2
  • 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

locked as resolved and limited conversation to collaborators on Mar 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @rvagg@jdmarshall@alxmrs@cclauss@ewallteam

        Issue actions

          gyp: binding.gyp not found (cwd: C:\Users\xxxx) while trying to load binding.gyp · Issue #1709 · nodejs/node-gyp