Closed shkfnly closed 6 years ago
I get similar issue on Ubuntu 12.04.5 LTS. when I try to install nodetime. Some suggest that python needs to be installed (which I have) so just posting this to hope that it helps you in case you do not have python installed.
@joemanfoo and installing python works? because I have python but that doesn't make this rebuild correctly.
when i install node-gyp manually npm install node-gyp
it installs just fine. so it leads me to believe the weak module which has node-gyp as dependency just uses it wrong. i made a ticket over there as well.
on darwin (MacOS)
xcode-select --install
did the job
@jfroffice, xcode-select --install
did not works for me, on Yosemite.
Downgrading node.js to the 0.10.x branch seems to fix the thing.
@kamisama, I am also on node.js 0.10.x.
this binding.gyp file is the biggest pain in the ass
Any solution for node 0.11.x yet? Getting the same error on Mac OSX 10.10. Works with node 0.10.x though.
If you are using Homebrew, this link was very usefull for me: http://flummox-engineering.blogspot.com.au/2014/04/libtool-unrecognized-option-static.html
brew unlink libtool
They was a conflict between usr/bin/libtool (Xcode) and usr/local/bin/libtool (HomeBrew)
Ditto what @Globegitter said: I've given up trying to get around this failed build on Mac OSX and Node v0.12 (I'm trying to npm install canvas
which requires node-gyp
) but once I removed Node and installed version 0.10.9 instead (directly from nodejs.org, rather than via Homebrew), canvas
and node-gyp
install fine.
My issue sounds more similar to https://github.com/Homebrew/homebrew/issues/14123 in that the error message when rebuilding node-gyp was Package 'xcb-shm', required by 'cairo', not found
, but the only solution that's worked for me so far was the Node version downgrade mentioned above.
http://stackoverflow.com/questions/22100213/package-cairo-was-not-found-in-the-pkg-config-search-path-node-j-s-install-canv This worked for me (answer by Piyush Dholariya)
@Arkantas Many Thanks for the link, It really helped me out :)
Same problem here. But I found my libtool
is actully /opt/chefdk/embedded/bin/libtool
, so sudo rm -rf /opt/chefdk
can solve my problem.
I raised this issue https://github.com/redis/hiredis-node/issues/94
gyp: binding.gyp not found ... big pain
I'm on El Capitan (10.11) and @veacks suggestion of brew unlink libtool
did the trick for me.
Just solved same problem.
In my case, Mac OS X automatic updates downloaded and installed a new version of XCode.
As you may know, you have to accept the license agreement in order to use both XCode and its command line tools.
libtool
is one of these command line tools. libtool
is used by node-gyp
.
I run libtool
and accepted license agreement via terminal.
Everything worked soon after.
@adriano-di-giovanni, I've tried running libtool to accept the agreement and got this output -
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: no files specified
Usage: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -static [-] file [...] [-filelist listfile[,dirname]] [-arch_only arch] [-sacLT] [-no_warning_for_no_symbols]
Usage: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -dynamic [-] file [...] [-filelist listfile[,dirname]] [-arch_only arch] [-o output] [-install_name name] [-compatibility_version #] [-current_version #] [-seg1addr 0x#] [-segs_read_only_addr 0x#] [-segs_read_write_addr 0x#] [-seg_addr_table <filename>] [-seg_addr_table_filename <file_system_path>] [-all_load] [-noall_load]
Could you help me solve this please?
Running libtool is just a shortcut to accept license agreement. I don't know why it fails on your machine but you can always open XCode and accept the license agreement.
Try and please, let me know π
Inviato da iPhone
Il giorno 02 nov 2015, alle ore 15:44, Yaron Idan notifications@github.com ha scritto:
@adriano-di-giovanni, I've tried running libtool to accept the agreement and got this output - error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: no files specified Usage: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -static [-] file [...] [-filelist listfile[,dirname]] [-arch_only arch] [-sacLT] [-no_warning_for_no_symbols] Usage: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -dynamic [-] file [...] [-filelist listfile[,dirname]] [-arch_only arch] [-o output] [-install_name name] [-compatibility_version #] [-current_version #] [-seg1addr 0x#] [-segs_read_only_addr 0x#] [-segs_read_write_addr 0x#] [-seg_addr_table ] [-seg_addr_table_filename ] [-all_load] [-noall_load]
Could you help me solve this please?
β Reply to this email directly or view it on GitHub.
True enough, XCode license wasn't my problem, and the license agreement was already accepted (as I found out through opening XCode like you advised) The problem ended up being node not upgraded to suit El-Capitan, after I upgraded it everything went pretty smooth...
Thank you for the support!
You're welcome π
Inviato da iPhone
Il giorno 03 nov 2015, alle ore 09:31, Yaron Idan notifications@github.com ha scritto:
True enough, XCode license wasn't my problem, and the license agreement was already accepted (as I found out through opening XCode like you advised) The problem ended up being node not upgraded to suit El-Capitan, after I upgraded it everything went pretty smooth...
Thank you for the support!
β Reply to this email directly or view it on GitHub.
I am on Yosemite (10.10.5) tried with Node 5.0.0 then with 0.10.x direct from Node.js website and have this issue and nothing listed above has fixed the problem.
I've had a similar issue with node-gyp and node v5.0.0 but it turned out to be the xcode that was causing issues. After accepting the license via sudo xcodebuild -license
it was a smooth ride.
@yaron-idan what did you mean you upgraded everything? What'd you upgrade?
@mmahalwy My node version was <5.0.0, I don't remember the exact number. After I've upgraded node to 5.0.0 and npm to 3.3.9 the problem was solved.
xcode-select --install
npm install -g npm@latest
worked for me
I have darwin and node 5.0 installed sudo xcodebuild -license
fix my issue. Thanks @qmmr
Same problem as @topherhunt while trying to install canvas.
brew install pkg-config
solved the problem for me.
this is a useful link... http://flummox-engineering.blogspot.com/2014/04/libtool-unrecognized-option-static.html
basically, if you're using GNU Libtool, you need to unlink it... I had to do this manually because I was using it, but not because of brew...
@adriano-di-giovanni suggestion works for me. Thanks for your post!
Ran all the suggested commands above and still didn't work. Restarted my computer and it started working magically. So if all fails, try restarting! π
I was having this problem on OSX v10.11.5 (15F34) running node v6.2.1 and sudo xcodebuild -license
seems to have resolved it. Weird.
Same issue with:
MacOSX 10.11.6 (also tried with MacOSX 10.11.5)
node v.6.3.1 (also tried with node v6.2.2)
npm 3.10.3
python 2.7.10
I did sudo xcodebuild -license
I did xcode-select --install
xcode-select: error: command line tools are already installed, use "Software Update" to install updates
Still doesn't work.
Then I tried brew unlink libtool
Error: No such keg: /usr/local/Cellar/libtool
Still doesn't work. Then I tried brew install pkg-config
Warning: pkg-config-0.29.1_1 already installed
Still no luck. Running out of ideas.
npm install -g node-gyp
works like a charm.
but npm install
still fails at:
> bcrypt@0.8.5 install /Users/xdamman/github/opencollective/api/node_modules/bcrypt
> node-gyp rebuild
My only luck was to downgrade node to v5.12.0
.
Update, I solved it. This was happening when npm was trying to install bcrypt.
For some reason, within the project, npm install bcrypt
was failing, but npm install -g bcrypt
worked. So running within the directory of the project npm link bcrypt
did the trick.
This is still weird. Not sure what's wrong with my setup.
Update 2: the reason why it was working with npm -g
is because it was installing bcrypt 0.8.7, whereas within the project directory, it was installing bcrypt 0.8.5. So updating the version number of bcrypt in package.json solved the issue. Mystery solved!
@xdamman cheers saved my night.
@xdamman thank you. Worked like charm after trying tons of suggestions.
None of the suggestions in this issue thread worked for me except downgrading node to 6.10.0 LTS
@mbutler Same here. I had lwip installing fine running node-gyp rebuild, then updated brew this morning and updated node from 7.7.2 to 7.7.3 and it broke it. After trying many things, finally uninstalled node from brew altogether and installed 6.10.0LTS from nodejs.org...
now I need to go back and discover what else has been broken by this whole process... :-/
tested in mac os x 10.11.6, using v6.10.1 and npm 4.4.4, I run npm install -g npm@latest node-gyp, and now I'm able to compile the modules
I just encountered this issue and realized that previously I had used pyenv
and changed my python version. Since it seems to be involved in the compiling of bcrypt (news to me), I had to change my python version back to 2.7.10
to make it work:
pyenv global 2.7.10
I use pyenv to manage my python installations, and I was unable to get node-gyp to build until I explicitly configured npm so that it used the correct python virtualenv shim, like so:
npm config set python /Users/your_username_here/.pyenv/versions/2.7.10/envs/virtual_env_name_here/bin/python
Do you know if pyenv
has a local registry that node-gyp
can query (or a stable path)?
@refack the .pyenv directory is typically at the user's home folder at $HOME/.pyenv but the path can also be determined by evaluating $(pyenv root)/
or by looking at the PYENV_ROOT
environment variable.
It seems like general installation issues (XCode license, etc.) was the issue here, as well as running on outdated versions of Node.js and node-gyp
. Upgrading Node.js / node-gyp
to a supported version will fix this problem, so going to close this this ticket for now since a fix has been identified.
Node v9.11.2 with npm 5.6.0 seemed working for me
For anyone who still runs into this issue, here's the fix: npm config set python /usr/bin/python
.
I finally figured out what the actual problem is. npm is being pointed to the userland python (typically installed by brew ... /usr/local/bin/python) not the system level python (/usr/bin/python). I just didn't know that there was a system level python.
@mattbontrager's solution fixed it for me. I had a Python 3 at /usr/local/bin/python
, and node-gyp needs Python 2 at /usr/bin/python
brew upgrade
worked for me. must not have done it since OSX update
You may want to look at what package you are trying to install. For instance, the firebase@latest package fails with node-gyp because it has an outdated grpc dependency. I was trying to do just that and ended up having to downgrade my node version to 10.13.0 in order to avoid the node-gyp build errors when installing firebase.
This helped me solve the problem of node-gyp version - https://github.com/nodejs/node-gyp/wiki/Updating-npm%27s-bundled-node-gyp
Terminal output