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

Ubuntu 12: binding.gyp not found when running node-gyp configure

Open jcollum opened this issue 13 years ago • 58 comments

13:59 vmplanet@ubuntu /usr/lib/node_modules/node-gyp $ sudo node-gyp configure
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | linux | ia32
gyp info spawn python
gyp info spawn args [ '/usr/lib/node_modules/node-gyp/gyp/gyp',
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   '/usr/lib/node_modules/node-gyp/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/usr/lib/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/home/vmplanet/.node-gyp/0.10.2/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/home/vmplanet/.node-gyp/0.10.2',
gyp info spawn args   '-Dmodule_root_dir=/usr/lib/node_modules/node-gyp',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.' ]
gyp: binding.gyp not found (cwd: /usr/lib/node_modules/node-gyp) 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/lib/node_modules/node-gyp/lib/configure.js:415:16)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:757:12)
gyp ERR! System Linux 3.2.0-39-generic-pae
gyp ERR! command "node" "/usr/bin/node-gyp" "configure"
gyp ERR! cwd /usr/lib/node_modules/node-gyp
gyp ERR! node -v v0.10.2
gyp ERR! node-gyp -v v0.9.5
gyp ERR! not ok

14:00 vmplanet@ubuntu /usr/lib/node_modules/node-gyp $ which python
/usr/bin/python

Ubuntu 12

jcollum avatar Apr 03 '13 21:04 jcollum

have you solved? Thank you. @largesoft

bubifengyun avatar Feb 17 '16 08:02 bubifengyun

I find it astonishing 3 years later this hasn't been fixed yet.

ghost avatar Apr 18 '16 13:04 ghost

@hocuspucus Can you stop posting content-free comments? If something isn't working for you, please file a new issue.

bnoordhuis avatar Apr 18 '16 14:04 bnoordhuis

The solution goes here (Worked for me):

sudo npm cache clean -f sudo npm install -g n sudo n 4.4.5 sudo npm install npm -g sudo npm uninstall node-gyp -g

Then try running npm install.

kala725 avatar May 30 '16 12:05 kala725

Thx kala725. Facing same issue on OSX el Capitan after mess with the node versions and it worked. In my case just npm uninstall node-gyp -g Thx again

ignaciolg avatar Jun 16 '16 22:06 ignaciolg

Your solution does not work, this is still broken.

niftylettuce avatar Jun 29 '16 21:06 niftylettuce

@niftylettuce Please don't hijack multiple threads.

bnoordhuis avatar Jun 29 '16 21:06 bnoordhuis

same as erdn. pluss reinstall make, gcc, g++ do the trick.

Thank u kala725

MuraraAllan avatar Oct 05 '16 21:10 MuraraAllan

Upgrade gcc version is solution for me, (default is 4.6.3 on my ubuntu 12.04)

$ gcc --version
gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3

The sequence of commands I ended up using were:

sudo apt-get install python-software-properties
$ sudo add-apt-repository ppa:ubuntu-toolchain-r/test
$ sudo apt-get update
$ sudo apt-get install gcc-4.8 g++-4.8
$ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 60 --slave /usr/bin/g++ g++ /usr/bin/g++-4.8

Checking again the gcc version:

$ gcc --version
gcc (Ubuntu 4.8.1-2ubuntu1~12.04) 4.8.1

Then go npm install or npm update on your node_modules.

I found the solution here: http://stackoverflow.com/questions/33532528/nodejs-4-5-npm-install-fail-for-bcrypt-and-db-migrate/33532529#33532529

huyb1991 avatar Oct 18 '16 04:10 huyb1991

after hours of searching here and there i got install "node-gyp" and its other related modules i tried all possible soulation

sudo npm cache clean -f sudo npm install -g n sudo n 4.4.5 sudo npm install npm -g sudo npm uninstall node-gyp -g

sudo add-apt-repository ppa:ubuntu-toolchain-r/test sudo apt-get update sudo apt-get install gcc-4.8 g++-4.8 sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 60 --slave /usr/bin/g++ g++ /usr/bin/g++-4.8

sudo npm install -g n sudo n stable npm rebuild npm install

sudo apt-get install mongodb make screen p ython-werkzeug python-jinja2 python-lxml python-iso8601 python-six python-setuptools

sudo apt-get install gcc libssl-dev g++ make

npm rebuild npm install

Now my node and npm version are: npm -v 4.0.5 node -v v7.4.0

baloda avatar Feb 16 '17 16:02 baloda

Thanks a Lot

praveencs87 avatar Mar 25 '17 11:03 praveencs87

didnt work for me.

also my docker ubuntu didnnt acecpt this command - sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 60 --slave /usr/bin/g++ g++ /usr/bin/g++-4.8

PManager1 avatar Apr 17 '17 22:04 PManager1

In my case I had to switch from node 8.1 back to node 7.10, remove node_modules and run again npm install.

Cristy94 avatar Jun 15 '17 22:06 Cristy94

@TooTallNate Still having this issue on macOS High Sierra.

I'm trying to build this repo.

gcc --versionoutput is:

Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 9.1.0 (clang-902.0.39.1)
Target: x86_64-apple-darwin17.5.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

npm -dd install output:

...
gyp verb gyp gyp format was not specified; forcing "make"
gyp info spawn /usr/bin/python
gyp info spawn args [ '/usr/local/lib/node_modules/npm/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/omatrot/Projects/sandbox/Djinnius/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/omatrot/.node-gyp/7.10.1/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/omatrot/.node-gyp/7.10.1',
gyp info spawn args   '-Dnode_gyp_dir=/usr/local/lib/node_modules/npm/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=node.lib',
gyp info spawn args   '-Dmodule_root_dir=/Users/omatrot/Projects/sandbox/Djinnius',
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/omatrot/Projects/sandbox/Djinnius) 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/npm/node_modules/node-gyp/lib/configure.js:308:16)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:194:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Darwin 17.5.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/omatrot/Projects/sandbox/Djinnius
gyp ERR! node -v v7.10.1
gyp ERR! node-gyp -v v3.5.0
gyp ERR! not ok

It seems to me that this binding.gyp file is effectively missing...

None of the forks contains such a file...

Any help appreciated.

omatrot avatar Apr 13 '18 18:04 omatrot

@omatrot The error message is accurate, there's no binding.gyp in that repo's top-level directory. It seems to be using gyp, not node-gyp.

bnoordhuis avatar Apr 13 '18 18:04 bnoordhuis

@bnoordhuis There is a gyp file indeed :( it is not named binding.gyp... It is using node-gyp:

npm info lifecycle [email protected]~install: [email protected]

[email protected] install /Users/omatrot/Projects/sandbox/Djinnius node-gyp rebuild

Not I'm facing another problem not related to node-gyp, but djinni :).

../deps/djinni/support-lib/jni/../proxy_cache_interface.hpp:137:49: error: cannot use typeid with -fno-rtti ~Handle() { if (m_obj) cleanup(m_cache, typeid(TagType), get_unowning(m_obj)); }

omatrot avatar Apr 14 '18 16:04 omatrot

@nfantone thanks a lot for this pro tips !

mauriau avatar Sep 04 '18 12:09 mauriau

Windows 10 solution: https://github.com/nodejs/node-gyp/issues/702#issuecomment-468214903

divgit avatar Feb 28 '19 10:02 divgit