node-libcurl: Getting error while using Node v4.2.4

Hello~

Could you help me diagnose my error? Everything was working fine when I was using Node v 0.12.7.

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

Error: dlopen(/Users/angie/projects/node-projects/search-api/node_modules/node-libcurl/lib/binding/node_libcurl.node, 1): Library not loaded: /Users/travis/lib/libcurl.4.dylib
  Referenced from: /Users/angie/projects/node-projects/search-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

OS: OSX 10.10.5 xcode: 7.2 libcurl: 7.43.0

Thanks!

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 36 (17 by maintainers)

Commits related to this issue

Most upvoted comments

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

> node-libcurl@0.8.0 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.

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

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

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.

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.

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

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