/usr/local/lib/node_modules# node-gyp rebuild
gyp info it worked if it ends with ok
gyp info using node-gyp@0.5.7
gyp info using node@0.8.1
gyp info spawn python
gyp info spawn args [ '/root/.node-gyp/0.8.1/tools/gyp_addon',
gyp info spawn args 'binding.gyp',
gyp info spawn args '-I/usr/local/lib/node_modules/build/config.gypi',
gyp info spawn args '-f',
gyp info spawn args 'make' ]
Traceback (most recent call last):
File "/root/.node-gyp/0.8.1/tools/gyp_addon", line 38, in <module>
rc = gyp.main(gyp_args)
File "/root/.node-gyp/0.8.1/tools/gyp/pylib/gyp/__init__.py", line 471, in main
options.circular_check)
File "/root/.node-gyp/0.8.1/tools/gyp/pylib/gyp/__init__.py", line 111, in Load
depth, generator_input_info, check, circular_check)
File "/root/.node-gyp/0.8.1/tools/gyp/pylib/gyp/input.py", line 2289, in Load
depth, check)
File "/root/.node-gyp/0.8.1/tools/gyp/pylib/gyp/input.py", line 361, in LoadTargetBuildFile
includes, True, check)
File "/root/.node-gyp/0.8.1/tools/gyp/pylib/gyp/input.py", line 208, in LoadOneBuildFile
raise Exception("%s not found (cwd: %s)" % (build_file_path, os.getcwd()))
Exception: binding.gyp not found (cwd: /usr/local/lib/node_modules) while trying to load binding.gyp
gyp ERR! rebuild error Error: `gyp_addon` failed with exit code: 1
gyp ERR! rebuild error at ChildProcess.onCpExit (/usr/local/lib/node_modules/node-gyp/lib/configure.js:290:16)
gyp ERR! rebuild error at ChildProcess.EventEmitter.emit (events.js:91:17)
gyp ERR! rebuild error at Process._handle.onexit (child_process.js:674:10)
gyp ERR! not ok
Your solution does not work, this is still broken.
Everyone,
node-gyp configure
must be run from the root directory of a node module. @jamcoupe Invoking it at/
is likely not what you want to do.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
@ctzurcanu what are you trying to use
node-gyp
for? It’s a tool for building native node modules, and every native node module should have abinding.gyp
file in the root.For example, you could clone
node-report
(a small native module in the nodejs foundation), and runnode-gyp configure
in that.Update, looks like @krylatij was on point. You have to run configure in a folder where binding.gyp is, or you will get this error.
Problem solved once I found the right folder.
Go to the folder with binding.gyp of your module and run “node-gyp configure” from it.
binding.gyp does not exist…
+1 for mac
same here ubuntu. damn hate this issue
Having the same problem with @seatownrocks, but on Ubuntu 16.04 LTS.
sudo npm i
@ctzurcanu I don’t think
wekan
is a native module.node-gyp
is for building native modules (i.e. C++ code not just JavaScript).But basically if you just want to use modules,
npm install
should just work (for native and non-native modules), you shouldn’t need to usenode-gyp
directly.After hours of struggling with this issue. All I did was
npm config set GYP_MSVS_VERSION 2015
. I also pointed Python to npm as well as Visual Studio version. Your .npmrc file found in the home directory should look like this:msvs_version=2015 python=C:Python27python.exe GYP_MSVS_VERSION=2015
Ofcourse having Visual C++ installed together with Visual Studio (I used community edition, it had both)
@gibfahn thank you. I wanted to build https://github.com/wekan/wekan and i see no binding.gyp in the source while in node-report is clearly present in the root… I should understand that the source there is incomplete.
one of about 7 issues i’ve been having installing node-gyp
So, I tried to use that : npm install iconv -g
And got this error.