GithubHelp home page GithubHelp logo

Comments (36)

kohanyirobert avatar kohanyirobert commented on June 24, 2024 8

Sorry for updating a closed issue, but I was having the same problem and I was able to solve it without building manually anything.

I just removed the module npm uninstall node-libcurl then reinstalled it npm install node-libcurl --build-from-source after that I saw the following

> node-pre-gyp install --fallback-to-build

  CXX(target) Release/obj.target/node_libcurl/src/node_libcurl.o
  CXX(target) Release/obj.target/node_libcurl/src/Easy.o
  CXX(target) Release/obj.target/node_libcurl/src/Share.o
  CXX(target) Release/obj.target/node_libcurl/src/Multi.o
  ...

and then it was working. If I just installed it with npm install node-libcurl the following was logged

> [email protected] install /Users/.../node_modules/node-libcurl
> node-pre-gyp install --fallback-to-build

[node-libcurl] Success: "/Users/.../node_modules/node-libcurl/lib/binding/node_libcurl.node" is installed via remote

I don't know what installed via remote means, but essentially it doesn't work that way, only if the library is built locally. Hope this helps others.

from node-libcurl.

meabed avatar meabed commented on June 24, 2024 7

@simiansim
you are right, i have installed

npm install node-pre-gyp -g
npm install node-libcurl --build-from-source --fallback-to-build

and it works just fine, i am sure this travis issue is something but the message displayed is wrong maybe.

from node-libcurl.

angelinetran avatar angelinetran commented on June 24, 2024 1

yay!

That did the trick.

Thank you so much!

Btw, for reference the first command needs to be switched around to be $ npm cache clean

from node-libcurl.

yoshprogrammer avatar yoshprogrammer commented on June 24, 2024 1

@JCMais I'm experiencing this issue as well... Any thoughts?

I have libcurl 7.43.0 and followed these same commands as you instructed. Even clearing the cache, deleting node_modules and rebuilding them.

module.js:435
  return process.dlopen(module, path._makeLong(filename));
                 ^

Error: dlopen(/Users/jbrown/Documents/projects/Weebly-API/node_modules/node-libcurl/lib/binding/node_libcurl.node, 1): Library not loaded: /Users/travis/lib/libcurl.4.dylib
  Referenced from: /Users/jbrown/Documents/projects/Weebly-API/node_modules/node-libcurl/lib/binding/node_libcurl.node
  Reason: Incompatible library version: node_libcurl.node requires version 9.0.0 or later, but libcurl.4.dylib provides version 7.0.0
    at Error (native)
    at Object.Module._extensions..node (module.js:435:18)
    at Module.load (module.js:344:32)
    at Function.Module._load (module.js:301:12)
    at Module.require (module.js:354:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/Users/jbrown/Documents/projects/Weebly-API/node_modules/node-libcurl/lib/Easy.js:38:29)
    at Module._compile (module.js:410:26)
    at Object.Module._extensions..js (module.js:417:10)
    at Module.load (module.js:344:32)
    at Function.Module._load (module.js:301:12)
    at Module.require (module.js:354:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/Users/jbrown/Documents/projects/Weebly-API/node_modules/node-libcurl/index.js:1:74)
    at Module._compile (module.js:410:26)
    at Object.Module._extensions..js (module.js:417:10)

from node-libcurl.

simiansim avatar simiansim commented on June 24, 2024 1

Just pointing this out that all of these people reported exactly "Library not loaded: /Users/travis/lib/libcurl.4.dylib", and I don't think any of those people are named "travis". This is a baked-in incorrect reference.

The compiled file "node_modules/node-libcurl/lib/binding/node_libcurl.node" contains this reference (BTW: the "Users/travis" directory does not exist on my machine either, in case that was a surprise). The fact that this actually works for most people on a Mac seems very accidental (It fails trying an invalid ref before trying other system paths).

Once rebuilt with the commands described above there is no such reference at all ("travis" or otherwise), in the binding file.

from node-libcurl.

koskokos2 avatar koskokos2 commented on June 24, 2024 1

I added one more path that will handle Brew when does not want to mess with system curl and is using special path. Now I think it is ready to be merged.

from node-libcurl.

JCMais avatar JCMais commented on June 24, 2024 1

just published an alpha release for that, if anyone wanna test: node-libcurl@next

from node-libcurl.

JCMais avatar JCMais commented on June 24, 2024

Hi, which version of the addon are you using?

from node-libcurl.

angelinetran avatar angelinetran commented on June 24, 2024

Which version of node-libcurl am I using? 0.7.0

from node-libcurl.

JCMais avatar JCMais commented on June 24, 2024

When you updated node.js, did you rebuilt the module? (aka, npm install node-libcurl)

If yes, try running npm install node-libcurl --build-from-source.

I don't have a Mac to test it, but looks like an issue with homebrew from what I can see searching for this error, can you try to update libcurl/homebrew?

from node-libcurl.

angelinetran avatar angelinetran commented on June 24, 2024

I didn't have homebrew on the computer I'm working in so I installed it, and now I have libcurl v7.46.0.

Running node . I get a different error:

module.js:460
  return process.dlopen(module, path._makeLong(filename));
                 ^

Error: Module version mismatch. Expected 46, got 14.
    at Error (native)
    at Object.Module._extensions..node (module.js:460:18)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:313:12)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
    at Object.<anonymous> (/Users/angie/projects/node/search-api/node_modules/node-libcurl/lib/Curl.js:27:14)
    at Module._compile (module.js:435:26)
    at Object.Module._extensions..js (module.js:442:10)
    at Module.load (module.js:356:32)

I also tried running tried running npm install node-libcurl --build-from-source and I get this error:

npm WARN enoent ENOENT, open '/Users/angie/projects/node/search-api/node_modules/bin/package.json'
npm WARN enoent ENOENT, open '/Users/angie/projects/node/search-api/node_modules/etc/package.json'
npm WARN enoent ENOENT, open '/Users/angie/projects/node/search-api/node_modules/lib/package.json'
npm WARN [email protected] No license field.
npm ERR! Darwin 15.2.0
npm ERR! argv "node" "/Users/angie/projects/node/search-api/node_modules/.bin/npm" "install" "node-libcurl" "--build-from-source"
npm ERR! node v0.12.7
npm ERR! npm  v3.5.2
npm ERR! path /Users/angie/projects/node/search-api/node_modules/.staging/abbrev-ad080861
npm ERR! code ENOENT
npm ERR! errno -2

npm ERR! enoent ENOENT, rename '/Users/angie/projects/node/search-api/node_modules/.staging/abbrev-ad080861'
npm ERR! enoent ENOENT, rename '/Users/angie/projects/node/search-api/node_modules/.staging/abbrev-ad080861'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent 

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/angie/projects/node/search-api/npm-debug.log

Thank you so much for helping me!

from node-libcurl.

JCMais avatar JCMais commented on June 24, 2024

Looks like an issue with npm, try cleaning the cache and reinstalling the node modules:

$ npm clean cache
$ rm -rf node_modules

from node-libcurl.

JCMais avatar JCMais commented on June 24, 2024

Glad you got it fixed!

from node-libcurl.

JCMais avatar JCMais commented on June 24, 2024

This is an issue with the libcurl version installed, it wants compatibility with library version 4 (Which probably means Mac 10.4), but this module only supports 9 (Mavericks, 10.9) or later. So it doesn't want to open libcurl.

I really don't know how to fix this since I don't own a Mac, but from what I could gather doing some research you can try to install homebrew which has a libcurl version compiled with the latest xcode.

from node-libcurl.

yoshprogrammer avatar yoshprogrammer commented on June 24, 2024

Interesting cause I'm running 10.10.5
I'll see if I can get it to work, otherwise I'll switch to laravel framework for the project im trying to do.

thanks

from node-libcurl.

yoshprogrammer avatar yoshprogrammer commented on June 24, 2024

Yeah I'm already running Homebrew and installed latest curl + libcurl so just an odd error. Bummer, was hoping this library would work for me.

Thanks anyways

from node-libcurl.

JCMais avatar JCMais commented on June 24, 2024

The Mac version you have installed is not the cause, but the minimum version required by the libcurl module (not this addon). This is set while compiling it.

from node-libcurl.

yoshprogrammer avatar yoshprogrammer commented on June 24, 2024

ahh I see, the libcurl itself is saying hey I need compatibility with 4 but this module is 9+

from node-libcurl.

JCMais avatar JCMais commented on June 24, 2024

yup, the easy way to fix that is you getting libcurl and compiling it from source, if you have the time to do that, it would be like the following:

$ cd ~
$ git clone https://github.com/curl/curl.git --single-branch --branch=curl-7_47_0 && cd curl
$ git checkout curl-7_47_0
$ export MACOSX_DEPLOYMENT_TARGET="10.8"
$ export PATH=$PATH:~/curl-binaries
$ ./configure --prefix=~/curl-binaries --with-darwinssl --disable-shared --enable-static
$ make && make install
$ npm install node-libcurl --build-from-source

from node-libcurl.

yoshprogrammer avatar yoshprogrammer commented on June 24, 2024

@JCMais i'll try that, i'd rather avoid losing some of the node work i've done so far for this project

from node-libcurl.

yoshprogrammer avatar yoshprogrammer commented on June 24, 2024

@JCMais running into a snag, it doesn't appear there is a configure file or directory when getting to that step, i've googled but not much help so far. Any pointers on what that means/why it's saying no such file or dir?

from node-libcurl.

JCMais avatar JCMais commented on June 24, 2024

I've missed the call to ./buildconf before the ./configure.

Ping me on gitter if you have other issues.

from node-libcurl.

yoshprogrammer avatar yoshprogrammer commented on June 24, 2024

Will do thanks for going above and beyond on this!

from node-libcurl.

JCMais avatar JCMais commented on June 24, 2024

I don't know what installed via remote means

It means that one pre built binary for your system was found, however you are probably getting one error when trying to use the library because it was compiled with one more recent toolchain, that your system currently doesn't have, that is why it works when you use --build-from-source, because it ignores the prebuilt binaries and just build it directly, using the toolchain you currently have.

from node-libcurl.

sridharspeaks avatar sridharspeaks commented on June 24, 2024

@kohanyirobert thank you, your solution simply worked for me.

from node-libcurl.

peterruijter avatar peterruijter commented on June 24, 2024

Sorry for commenting on this closed issue, but what helped me to solve this problem is:
brew update && brew upgrade and lastly brew reinstall curl

The suggested solution that @JCMais gave on 4 Feb 2016, does not create or replace the libcurl.4.dylib file what the source of the problem is and where the compiler is complaining about.

I hope this solution will work for someone else too...

from node-libcurl.

simiansim avatar simiansim commented on June 24, 2024

What you are doing by running brew is to separately install curl and ensure that libcurl.4.dylib is "somewhere" on your system path & it only works if the place that brew installs it is also on your system path. While I am not sure, I suspect (hope) that @JCMais is updating the build automation (travis) that creates the bindings so that you don't have to fix it externally.

from node-libcurl.

JCMais avatar JCMais commented on June 24, 2024

I'm keeping an eye on this issue, but currently I'm not having time to work on it, if anyone has the opportunity and know-how to fix it, it would be awesome.

from node-libcurl.

JCMais avatar JCMais commented on June 24, 2024

reopening this since it's still an issue.

For a matter of fact, there is travis on the path of the linked library because the process of generating macOS prebuilt binaries is by building the library in a macOS environment on Travis CI, the build config is here if anyone can take a look: https://github.com/JCMais/node-libcurl/blob/84006ec/.travis.yml

This issue is really hard for me to track down, since I don't have access to a mac right now.

from node-libcurl.

koskokos2 avatar koskokos2 commented on June 24, 2024

Full path should be replaced with @rpath and rpaths added for mac, so basically after node_libcurl.node is built we need to execute:

install_name_tool -change /Users/travis/lib/libcurl.4.dylib @rpath/libcurl.4.dylib node_libcurl.node && install_name_tool -add_rpath /opt/local/lib node_libcurl.node && install_name_tool -add_rpath /usr/lib node_libcurl.node

from node-libcurl.

koskokos2 avatar koskokos2 commented on June 24, 2024

I submitted changes to binding.gyp that will fix this issue. They make output of "otool -L" look way better and "otool -l" has standard paths to libs on mac.
otool -L lib/binding/node_libcurl.node
lib/binding/node_libcurl.node:
@rpath/libcurl.dylib (compatibility version 10.0.0, current version 10.0.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 307.4.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1238.0.0)

from node-libcurl.

simiansim avatar simiansim commented on June 24, 2024

I tried @koskokos2's branch "linking-improvement-mac", and found it works mostly... certainly looking in the right direction.

Specifically the use of install_name_tool to change the linking paths is important. Playing with the specific set of paths passed to install_name_tool -change will likely be the solution.
https://github.com/koskokos2/node-libcurl/blob/linking-improvement-mac/binding.gyp#L119

my results.

doing an npm install resulted in a lib/binding/node_libcurl.node binary file that contains a reference to "/Users/travis" (visually found string within the binary file). Running some code that used the module resulted in Reason: Incompatible library version: node_libcurl.node requires version 10.0.0 or later, but libcurl.4.dylib provides version 7.0.0
I assume this is using a prebuilt binary and so once these binaries are replaced maybe it will start to work.

npm install --rebuild --build-from-source

So at this point my test code started to work... but again I am worried it is finding the path incorrectly. I am including info about my system. /usr/local/lib seems to be my working lib location.

The resulting binding file contained a reference using @rpath and some system paths
@rpath/libcurl.dylib, /opt/local/lib, /usr/local/lib, /usr/lib

otool run against the binding file shows an issue

otool -L lib/binding/node_libcurl.node 
lib/binding/node_libcurl.node:
        @rpath/libcurl.dylib (compatibility version 7.0.0, current version 9.0.0)
        /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 400.9.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.50.4)

on my system the build seems to point towards
/usr/lib/libcurl.4.dylib as the destination location place to find libcurl. otool reports this as 7.0.0 compatible,
/usr/local/lib/libcurl.4.dylib reports as 9.0.0 compatible,
and /usr/local/Cellar/curl/7.61.0/lib/libcurl.4.dylib (the one homebrew will install) reports as 10.0.0 compatible.

...I am not an expert on otool and install_name_tool (and its tricks like rpath) either. I found this background info:
https://medium.com/@donblas/fun-with-rpath-otool-and-install-name-tool-e3e41ae86172
https://wincent.com/wiki/@executable_path,_@load_path_and_@rpath

from node-libcurl.

berstend avatar berstend commented on June 24, 2024

Ran into the same issue today:

 Reason: Incompatible library version: node_libcurl.node requires version 10.0.0 or later, but libcurl.4.dylib provides version 7.0.0

Switched to @koskokos2's branch (thanks!) and everything is super now 🎉:

yarn add koskokos2/node-libcurl#linking-improvement-mac
console.log(require('node-libcurl').Curl.getVersion())
// => libcurl/7.43.0 SecureTransport zlib/1.2.5

from node-libcurl.

simiansim avatar simiansim commented on June 24, 2024

LGTM too.

from node-libcurl.

pietermees avatar pietermees commented on June 24, 2024

@JCMais worked for me!

from node-libcurl.

JCMais avatar JCMais commented on June 24, 2024

Glad to hear, all props to @koskokos2 for the awesome work!

I will cut a major release some time next week.

from node-libcurl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.