Comments (36)
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.
@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.
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.
@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.
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.
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.
just published an alpha release for that, if anyone wanna test: node-libcurl@next
from node-libcurl.
Hi, which version of the addon are you using?
from node-libcurl.
Which version of node-libcurl am I using? 0.7.0
from node-libcurl.
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.
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.
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.
Glad you got it fixed!
from node-libcurl.
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.
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.
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.
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.
ahh I see, the libcurl itself is saying hey I need compatibility with 4 but this module is 9+
from node-libcurl.
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.
@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.
@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.
I've missed the call to ./buildconf
before the ./configure
.
Ping me on gitter if you have other issues.
from node-libcurl.
Will do thanks for going above and beyond on this!
from node-libcurl.
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.
@kohanyirobert thank you, your solution simply worked for me.
from node-libcurl.
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.
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.
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.
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.
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.
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.
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.
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.
LGTM too.
from node-libcurl.
@JCMais worked for me!
from node-libcurl.
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)
- How can I write a custom request asynchronously? HOT 1
- [feat] rewrite `node-libcurl` with, the **ONLY** isomorphic way, napi HOT 1
- Curl Easy segmentation fault with requests to external site HOT 3
- Expected npx node-libcurl $URL to work as curl $URL HOT 1
- TypeError: Class extends value #<Object> is not a constructor or null HOT 1
- HTTP_CONTENT_DECODING = false but still decodes the server's responses HOT 1
- How to make multiple curly instances maintain separate connections to same host? HOT 2
- unable to npm install HOT 3
- npm install issues. HOT 5
- libcurl vuln HOT 2
- Add prebuilt binaries for nodejs 20 LTS HOT 13
- read raw msg HOT 3
- Does node-libcurl support res_init? HOT 1
- Error after upgrade to Node 20.10 ...: ERR_DLOPEN_FAILED HOT 2
- SFTP / SSH stuck on login when using Curl/Multi and password auth HOT 2
- Curly - Close connection - Timeout Exception HOT 3
- Cannot install HOT 3
- Send binary data with HTTPPOST option HOT 1
- Hanging on PROTOCONNECTING
- Add prebuilt binaries for node 21(macOS) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-libcurl.