jcmais / node-libcurl Goto Github PK
View Code? Open in Web Editor NEWlibcurl bindings for Node.js
Home Page: https://npmjs.org/package/node-libcurl
License: MIT License
libcurl bindings for Node.js
Home Page: https://npmjs.org/package/node-libcurl
License: MIT License
with the lib:
Error: Peer certificate cannot be authenticated with given CA certificates
any ideas?
Hi,
It could be wrong but it looks like the CURLOPT for SSH_AUTH_TYPES is missing.
I can see that you have provided the relevant settings in Curl.ssh_auth
here but when I try to implement it, I get
Error: Unknown option given. First argument must be the option internal id or the option name.
The following should reproduce the error:
var Curl = require('node-libcurl').Curl
curl = new Curl()
curl.setOpt(Curl.option.VERBOSE, true)
curl.setOpt(Curl.option.URL, "sftp://user:[email protected]")
curl.setOpt(Curl.option.SSH_AUTH_TYPES, Curl.ssh_auth.PASSWORD)
curl.perform()
Hey there,
Thanks again for this awesome module. I've ran into a quite weird compile error today. Basically the module builds just fine on OSX (10.10.3) with node
and npm
versions v0.12.4
and 2.10.1
respectively. However, on Linux (Arch, package versions v0.12.4
and 2.11.1
) it fails.
The relevant part of the error log:
make: Entering directory '/tmp/node_modules/node-libcurl/build'
CXX(target) Release/obj.target/node-libcurl/src/node-libcurl.o
CXX(target) Release/obj.target/node-libcurl/src/Curl.o
In file included from ../src/Curl.cc:18:0:
../src/generated-stubs/curlAuth.h:16:1: error: narrowing conversion of '18446744073709551599ul' from 'long unsigned int' to 'int32_t {aka int}' inside { } [-Wnarrowing]
};
^
../src/generated-stubs/curlAuth.h:16:1: error: narrowing conversion of '18446744073709551598ul' from 'long unsigned int' to 'int32_t {aka int}' inside { } [-Wnarrowing]
../src/generated-stubs/curlAuth.h:16:1: error: narrowing conversion of '2147483648ul' from 'long unsigned int' to 'int32_t {aka int}' inside { } [-Wnarrowing]
node-libcurl.target.mk:94: recipe for target 'Release/obj.target/node-libcurl/src/Curl.o' failed
make: *** [Release/obj.target/node-libcurl/src/Curl.o] Error 1
make: Leaving directory '/tmp/node_modules/node-libcurl/build'
Cheers
During build I've got an error described bellow
string_format.cc
..\src\string_format.cc(11): error C2220: warning treated as error - no 'object' file generated [\node_modules\node-libcurl\build\node-libcurl.vcxproj]
..\src\string_format.cc(11): warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data [\node_modules\node-libcurl\build\node-libcurl.vcxpro
j]
..\src\Curl.cc(474): error C2220: warning treated as error - no 'object' file generated [\node_modules\node-libcurl\build\node-libcurl.vcxproj]
..\src\Curl.cc(474): warning C4267: '+=' : conversion from 'size_t' to 'int', possible loss of data [\node_modules\node-libcurl\build\node-libcurl.vcxproj]
..\src\Curl.cc(483): warning C4267: '+=' : conversion from 'size_t' to 'int', possible loss of data [\node_modules\node-libcurl\build\node-libcurl.vcxproj]
..\src\Curl.cc(740): warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data [\node_modules\node-libcurl\build\node-libcurl.vcxproj]
Env: Win 7 x64, VS 2013 update 4, python 2.7.9, node 0.10.34, npm 1.4.28
It's strange because i don't have any issues on Win 8.1 32bit, VS 2013 update 4. I have no idea how to fix this issue.
Hi,
I am also getting a similar error and seriously got strucked here.
npm WARN package.json [email protected] No repository field.
npm WARN engine [email protected]: wanted: {"node":">= 0.8.0 && < 0.11.0"} (current: {"node":"0.10.36","npm":"1.4.28"})
[email protected] install /usr/local/node/ayla/node_modules/node-libcurl
node tools/retrieve-win-deps && node tools/generate-stubs && node-gyp rebuild
Cannot find curl's header file.
npm ERR! [email protected] install: node tools/retrieve-win-deps && node tools/generate-stubs && node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the node-libcurl package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node tools/retrieve-win-deps && node tools/generate-stubs && node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls node-libcurl
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 2.6.32-431.17.1.el6.x86_64
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" "node-libcurl"
npm ERR! cwd /usr/local/node/ayla
npm ERR! node -v v0.10.36
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
npm ERR! not ok code 0
Just wanted to check if there is any solution available. Also may be due to this erorr, I am unable to do npm install node-curl.
Here is my curl version details
curl 7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.15.3 zlib/1.2.3 libidn/1.18 libssh2/1.4.2
Protocols: tftp ftp telnet dict ldap ldaps http file https ftps scp sftp
Features: GSS-Negotiate IDN IPv6 Largefile NTLM SSL libz
and here is my npm install --loglevel verbose. It appears that I haven't placed any package.json as I dont maintain any specific version dependencies. Does this cause a problem?
npm info it worked if it ends with ok
npm verb cli [ '/usr/bin/node',
npm verb cli '/usr/bin/npm',
npm verb cli 'install',
npm verb cli '--loglevel',
npm verb cli 'verbose' ]
npm info using [email protected]
npm info using [email protected]
npm ERR! install Couldn't read dependencies
npm ERR! package.json ENOENT, open '/usr/local/node/ayla/package.json'
npm ERR! package.json This is most likely not a problem with npm itself.
npm ERR! package.json npm can't find a package.json file in your current directory.
npm ERR! System Linux 2.6.32-431.17.1.el6.x86_64
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" "--loglevel" "verbose"
npm ERR! cwd /usr/local/node/ayla
npm ERR! node -v v0.10.36
npm ERR! npm -v 1.4.28
npm ERR! path /usr/local/node/ayla/package.json
npm ERR! code ENOPACKAGEJSON
npm ERR! errno 34
npm verb exit [ 34, true ]
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /usr/local/node/ayla/npm-debug.log
npm ERR! not ok code 0
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!
Hi there, thanks for this awesome library. It is really cool!
I am currently sending a very large binary string in the POSTFIELD and when I don't set a POSTFIELDSIZE it truncates my binary string. So I set the POSTFIELDSIZE as my data.length and it sends a lot more of the binary string but it is still truncating the data.
Seems like there's not possible to compile old versions of [email protected] and [email protected]. In node 5, only versions @1.2.1 are working. Here is the output log:
$ npm install [email protected] --save --save-exact
npm WARN prefer global [email protected] should be installed with -g
[email protected] install /Users/aberope/robots/kobol/node_modules/slack-cli/node_modules/bufferutil
node-gyp rebuild
CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
In file included from ../src/bufferutil.cc:16:
../../nan/nan.h:261:25: error: redefinition of '_NanEnsureLocal'
[.....]
gyp ERR! build error
gyp ERR! stack Error: make
failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:276:23)
gyp ERR! stack at emitTwo (events.js:100:13)
gyp ERR! stack at ChildProcess.emit (events.js:185:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:204:12)
gyp ERR! System Darwin 15.4.0
gyp ERR! command "/usr/local/Cellar/node/5.8.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/aberope/robots/kobol/node_modules/slack-cli/node_modules/bufferutil
gyp ERR! node -v v5.8.0
gyp ERR! node-gyp -v v3.2.1
gyp ERR! not ok
npm WARN install:[email protected] [email protected] install: node-gyp rebuild
npm WARN install:[email protected] Exit status 1
[...]
npm WARN install:[email protected] [email protected] install: node-gyp rebuild
npm WARN install:[email protected] Exit status 1
Updating NAN to 2.0 is required to make this work, which is currently being blocked by nodejs/nan#389
Both options were introduced with 7.37.
For reference: http://curl.haxx.se/libcurl/c/CURLOPT_HEADEROPT.html
I'm trying to figure out a list of all the options available. In your examples for uploading a file, you use curl.option.HTTPPOST
. HTTPPOST
is not a listed valid curl option in any documentation that I can see. I see POST
but not HTTPPOST
. So anyways, according to your doc's, the curl.option
is an Object with all the valid options in it. So in an attempt to learn more, I did this:
var Curl = require('node-libcurl').Curl;
var curl = new Curl();
console.log(curl.option);
I get undefined
. Am I missing something here? How do I see the list of all available options? I need to upload a file using http PUT, but I have no idea what option name to use for this in your library...
$ npm install node-libcurl --save
npm WARN engine [email protected]: wanted: {"node":">= 0.10.0 && <= 0.12","iojs":">= 1.0.0"} (current: {"node":"0.12.6","npm":"2.11.2"})
\
> [email protected] install /home/user/github/docker-mongo-cluster/cluster/node_modules/node-libcurl
> node tools/retrieve-win-deps && node tools/generate-stubs && pangyp rebuild
Cannot find curl's header file.
npm ERR! Linux 3.13.0-32-generic
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "node-libcurl" "--save"
npm ERR! node v0.12.6
npm ERR! npm v2.11.2
npm ERR! code ELIFECYCLE
npm ERR! [email protected] install: `node tools/retrieve-win-deps && node tools/generate-stubs && pangyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node tools/retrieve-win-deps && node tools/generate-stubs && pangyp rebuild'.
npm ERR! This is most likely a problem with the node-libcurl package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node tools/retrieve-win-deps && node tools/generate-stubs && pangyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls node-libcurl
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /home/user/github/docker-mongo-cluster/cluster/npm-debug.log
gcc:
$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.8/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.8.4-2ubuntu1~14.04' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libmudflap --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04)
system - stuff:
$ uname -a
Linux fentaso 3.13.0-32-generic #57-Ubuntu SMP Tue Jul 15 03:51:08 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
$ python --version
Python 2.7.6
$ curl --version
curl 7.35.0 (x86_64-pc-linux-gnu) libcurl/7.35.0 OpenSSL/1.0.1f zlib/1.2.8 libidn/1.28 librtmp/2.3
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp smtp smtps telnet tftp
Features: AsynchDNS GSS-Negotiate IDN IPv6 Largefile NTLM NTLM_WB SSL libz TLS-SRP
After some search I found following solution:
$ sudo apt-get install libcurl3-dev
Just wanted to let you know.
Hi, I'm just trying to do a simple FTP get and hitting a segfault on Ubuntu 14.04.3 LTS with Node 0.10.40 and libcurl 7.35.0.
It works locally on my macbook (osx 10.10.5 / node 0.10.40 / libcurl 7.43.0)
From poking around other segfault issues reported here, it's clear they are very hard to reproduce.
Here's what I use to trigger the error. The ftp host and credentials have been swapped out for dummy credentials.
var Curl, curl;
Curl = require('node-libcurl').Curl;
curl = new Curl;
curl.setOpt(Curl.option.URL, "ftp://dummyuser:[email protected]/feed.csv");
curl.setOpt(Curl.option.VERBOSE, 1);
curl.setOpt(Curl.option.DEBUGFUNCTION, require('./debug')); // returns the debug function from node-libcurl examples
curl.on('end', function() {
return console.log(arguments, curl.getInfo(Curl.info.SIZE_DOWNLOAD));
});
curl.perform();
Which results in a segfault just as the transfer is about to begin.
Hostname was NOT found in DNS cache
Trying x.x.x.x...
Connected to inbound.acme.com (x.x.x.x) port 21 (#0)
-- RECEIVING HEADER:
220 Acme LLC
-- SENDING HEADER:
USER dummyuser
-- RECEIVING HEADER:
331 Please specify the password.
-- SENDING HEADER:
PASS dummypass
-- RECEIVING HEADER:
230 Login successful.
-- SENDING HEADER:
PWD
-- RECEIVING HEADER:
257 "/"
Entry path is '/'
-- SENDING HEADER:
PASV
Connect data stream passively
ftp_perform ends with SECONDARY: 0
-- RECEIVING HEADER:
227 Entering Passive Mode (x,x,x,x,159,192).
Hostname was NOT found in DNS cache
Trying x.x.x.x...
Connecting to x.x.x.x (x.x.x.x) port 40000
PID 14645 received SIGSEGV for address: 0x1c81
/home/dev/workspace/myapp/node_modules/segfault-handler/build/Release/segfault-handler.node(+0x1973)[0x7f0a0c176973]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x10340)[0x7f0a15665340]
/usr/lib/x86_64-linux-gnu/libcurl.so.4(+0x3042c)[0x7f0a14e3a42c]
/usr/lib/x86_64-linux-gnu/libcurl.so.4(+0x30cca)[0x7f0a14e3acca]
/usr/lib/x86_64-linux-gnu/libcurl.so.4(+0x335be)[0x7f0a14e3d5be]
/usr/lib/x86_64-linux-gnu/libcurl.so.4(curl_multi_socket_action+0x17)[0x7f0a14e3d627]
/home/dev/workspace/myapp/node_modules/node-libcurl/lib/binding/node_libcurl.node(_ZN11NodeLibcurl5Multi8OnSocketEP9uv_poll_sii+0x4d)[0x7f0a1508755d]
/home/dev/.nvm/v0.10.40/bin/node(uv__io_poll+0x300)[0x9e5a40]
/home/dev/.nvm/v0.10.40/bin/node(uv_run+0xd8)[0x9d9398]
/home/dev/.nvm/v0.10.40/bin/node(_ZN4node5StartEiPPc+0x16c)[0x9853ec]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5)[0x7f0a152b1ec5]
/home/dev/.nvm/v0.10.40/bin/node(cos+0x129)[0x5a54a9]
So whatever is going wrong is happening in NodeLibcurl::Multi::OnSocket(uv_poll_s*, int, int)
I guess but I'm not sure how to debug any further than that.
Any help anyone could offer would be greatly appreciated. Let me know if I need to provide any more information for context.
Hi,
the "top500" example code gives me the following error:
/home/myuser/Projects/MyProject/node_modules/node-libcurl/lib/Curl.js:326
return this._setOpt( optionIdOrName, optionValue );
^
Error: Unknown option given. First argument must be the option internal id or the option name. You can use the Curl.option constants.
at Curl.setOpt (/home/myuser/Projects/MyProject/node_modules/node-libcurl/lib/Curl.js:326:17)
at doRequest (/home/myuser/Projects/MyProject/top500.js:39:10)
at Object. (/home/myuser/Projects/MyProject/top500.js:18:5)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:929:3
The line the gives the error is:
curl.setOpt( Curl.option.PRIVATE, siteUrl );
Is the PRIVATE option supported? You're writing in http://curl-library.cool.haxx.narkive.com/bFH3TXjM/add-node-js-binding
Here is the current list of options not implemented:
-- Options related to pass data around (Not needed because of the nature of javascript).
PROGRESSDATA, XFERINFODATA, DEBUGDATA, PRIVATE, etc.
Thanks a lot,
Gy.
When a curl request times out, the node process crashes within the winsock closesocket() call.
The call stack is as follows:
closesocket()
Curl_closesocket()
conn_free()
Curl_disconnect()
Curl_done()
curl_multi_remove_handle()
Curl::ProcessMessages()
Curl::OnTimeout()
uv_timer_get_repeat()
uv_run()
Any advice on how to resolve?
I would like to be able to "retry" a curl request (with exactly the same options), without having to redefine all opts manually. Is they a way to do this ?
For example :
var curl=new Curl();
curl.setOpt('URL',url);
curl.setOpt('FOLLOWLOCATION',true);
curl.setOpt('SSL_VERIFYPEER', false);
var curlRetry = curl.clone()
curl.on('end', function(statusCode) {
if (statusCode===404) {
curlRetry.perform();
}
})
curl.perform();
_.each({
"Node.js": {
filename: somefilenamehere,
url: someurlhere
},
"Electron Shell": {
filename: somefilenamehere
url: someurlhere
}
}, function (requirement, name) {
// pretty much a carbon copy of the progress bar example.
});
The output doesn't seem to work as expected.
This is probably something I'm doing wrong, but what's the fix for this?
I am in the process of downloading the node-libcurl module onto an offline CentOS server. Using npmbox (https://github.com/arei/npmbox), I've packaged node-libcurl and downloaded it onto the server. I have also downloaded the libcurl devel package and gotten the following result.
$ sudo yum install libcurl-devel
http://yum0002.svc.eng.wd5.wd//repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
Trying other mirror.
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package libcurl-devel.x86_64 0:7.19.7-37.el6_5.3 will be installed
--> Processing Dependency: libidn-devel for package: libcurl-devel-7.19.7-37.el6_5.3.x86_64
--> Processing Dependency: automake for package: libcurl-devel-7.19.7-37.el6_5.3.x86_64
--> Running transaction check
---> Package automake.noarch 0:1.11.1-4.el6 will be installed
--> Processing Dependency: autoconf >= 2.62 for package: automake-1.11.1-4.el6.noarch
---> Package libidn-devel.x86_64 0:1.18-2.el6 will be installed
--> Running transaction check
---> Package autoconf.noarch 0:2.63-5.1.el6 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
============================================================================================================================================
Package Arch Version Repository Size
============================================================================================================================================
Installing:
libcurl-devel x86_64 7.19.7-37.el6_5.3 C65-Updates 244 k
Installing for dependencies:
autoconf noarch 2.63-5.1.el6 C65-DVD 781 k
automake noarch 1.11.1-4.el6 C65-DVD 550 k
libidn-devel x86_64 1.18-2.el6 C65-DVD 137 k
Transaction Summary
============================================================================================================================================
Install 4 Package(s)
Total download size: 1.7 M
Installed size: 4.8 M
Is this ok [y/N]: y
Downloading Packages:
(1/4): autoconf-2.63-5.1.el6.noarch.rpm | 781 kB 00:00
(2/4): automake-1.11.1-4.el6.noarch.rpm | 550 kB 00:00
(3/4): libcurl-devel-7.19.7-37.el6_5.3.x86_64.rpm | 244 kB 00:00
(4/4): libidn-devel-1.18-2.el6.x86_64.rpm | 137 kB 00:00
--------------------------------------------------------------------------------------------------------------------------------------------
Total 21 MB/s | 1.7 MB 00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : autoconf-2.63-5.1.el6.noarch 1/4
Installing : automake-1.11.1-4.el6.noarch 2/4
Installing : libidn-devel-1.18-2.el6.x86_64 3/4
Installing : libcurl-devel-7.19.7-37.el6_5.3.x86_64 4/4
Verifying : libidn-devel-1.18-2.el6.x86_64 1/4
Verifying : libcurl-devel-7.19.7-37.el6_5.3.x86_64 2/4
Verifying : autoconf-2.63-5.1.el6.noarch 3/4
Verifying : automake-1.11.1-4.el6.noarch 4/4
Installed:
libcurl-devel.x86_64 0:7.19.7-37.el6_5.3
Dependency Installed:
autoconf.noarch 0:2.63-5.1.el6 automake.noarch 0:1.11.1-4.el6 libidn-devel.x86_64 0:1.18-2.el6
Complete!
Attempting to unpackage the node-libcurl npmbox results in the following error:
$ npmunbox node-libcurl.npmbox
Unboxing node-libcurl.npmbox...
Unpacking node-libcurl...
Installing node-libcurl...
{ [Error: [email protected] install: `node tools/retrieve-win-deps && node tools/generate-stubs && pangyp rebuild`
Exit status 1]
code: 'ELIFECYCLE',
pkgid: '[email protected]',
stage: 'install',
script: 'node tools/retrieve-win-deps && node tools/generate-stubs && pangyp rebuild',
pkgname: 'node-libcurl' }
The build log is 129kb, but here's the important part
d:\git\mine\curl\node_modules\node-libcurl\node_modules\nan\nan_implementation_12_inl.h(181): error C2660: 'v8::Signature::New' : function does not take 4 arguments (..\src\Curl.cc) [d:\Git\Mine\curl\node_modules\node-libcurl\build\node-libcurl.vcxproj]
d:\git\mine\curl\node_modules\node-libcurl\node_modules\nan\nan_implementation_12_inl.h(181): error C2660: 'v8::Signature::New' : function does not take 4 arguments (..\src\node-libcurl.cc) [d:\Git\Mine\curl\node_modules\node-libcurl\build\node-libcurl.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Program Files\iojs\node_modules\npm\node_modules\node-gyp\lib\build.js:269:23)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:169:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:1009:12)
gyp ERR! System Windows_NT 6.3.9600
gyp ERR! command "C:\\Program Files\\iojs\\node.exe" "C:\\Program Files\\iojs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd d:\Git\Mine\curl\node_modules\node-libcurl
gyp ERR! node -v v2.0.1
gyp ERR! node-gyp -v v1.0.3
gyp ERR! not ok
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files\\iojs\\node.exe" "C:\\Program Files\\iojs\\node_modules\\npm\\bin\\npm-cli.js" "install" "node-libcurl"
npm ERR! node v2.0.1
npm ERR! npm v2.9.0
npm ERR! code ELIFECYCLE
npm ERR! [email protected] install: `node tools/retrieve-win-deps && node tools/generate-stubs && node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node tools/retrieve-win-deps && node tools/generate-stubs && node-gyp rebuild'.
npm ERR! This is most likely a problem with the node-libcurl package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node tools/retrieve-win-deps && node tools/generate-stubs && node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls node-libcurl
npm ERR! There is likely additional logging output above.
I'm assuming that it's not supported but I thought I'd raise an issue anyway.
Hi guys, used node-libcurl 0.5.1 in project, there was no problem with it. Then migrated deployment to another server with Debian 7, and it failed to compile there, changed to newer 0.6.3 --> on server Debian now compiles, but on my local machine (Elementary OS (based on Ubuntu Precise 12.04) it now doesn't (although older version 0.5.1 still compiles locally).
I got problem since newer version of node-libcurl 0.6.3 on my local machine:
Linux Elementary OS Luna (Ubuntu Precise 12.04) kernel 3.11.0-26-generic x64 Intel core i5
node -v 0.12.4
npm -v 2.13.3
python -v 2.7
node-gyp -v 3.0.3
gcc -v 4.9.2 g++ 4.9.2
cmake --version 3.3.0-rc3
The output console error:
36 clang 0x000000000058dd39
Stack dump:
0. Program arguments: /usr/bin/clang -cc1 -triple x86_64-pc-linux-gnu -emit-obj -disable-free -disable-llvm-verifier -main-file-name Multi.cc -pic-level 2 -mdisable-fp-elim -masm-verbose -mconstructor-aliases -munwind-tables -target-cpu x86-64 -target-linker-version 2.22 -momit-leaf-frame-pointer -ffunction-sections -fdata-sections -coverage-file Release/obj.target/node-libcurl/src/Multi.o -resource-dir /usr/bin/../lib/clang/3.0 -dependency-file ./Release/.deps/Release/obj.target/node-libcurl/src/Multi.o.d.raw -MT Release/obj.target/node-libcurl/src/Multi.o -D NODE_GYP_MODULE_NAME=node-libcurl -D _LARGEFILE_SOURCE -D _FILE_OFFSET_BITS=64 -D BUILDING_NODE_EXTENSION -I /home/musichen/.node-gyp/0.12.4/src -I /home/musichen/.node-gyp/0.12.4/deps/uv/include -I /home/musichen/.node-gyp/0.12.4/deps/v8/include -I ../node_modules/nan -fmodule-cache-path /var/tmp/clang-module-cache -internal-isystem /usr/include/c++/4.6 -internal-isystem /usr/include/c++/4.6/x86_64-linux-gnu -internal-isystem /usr/include/c++/4.6/backward -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/clang/3.0/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /usr/include -O2 -Wall -Wextra -Wno-unused-parameter -Wno-narrowing -std=c++11 -fdeprecated-macro -ferror-limit 19 -fmessage-length 160 -pthread -fno-rtti -fgnu-runtime -fobjc-runtime-has-arc -fobjc-runtime-has-weak -fobjc-fragile-abi -fdiagnostics-show-option -fcolor-diagnostics -o Release/obj.target/node-libcurl/src/Multi.o -x c++ ../src/Multi.cc
1. ../src/Multi.cc:32:180: current parser token ';'
2. ../src/Multi.cc:25:1: parsing namespace 'NodeLibcurl'
3. ../src/Multi.cc:30:5: parsing function body 'Multi'
4. ../src/Multi.cc:30:5: in compound statement ('{}')
clang: error: unable to execute command: Segmentation fault
clang: error: clang frontend command failed due to signal 2 (use -v to see invocation)
clang: note: diagnostic msg: Please submit a bug report to http://llvm.org/bugs/ and include command line arguments and all diagnostic information.
clang: note: diagnostic msg: Preprocessed source(s) are located at:
clang: note: diagnostic msg: /tmp/Multi-9i56WC.ii
make: *** [Release/obj.target/node-libcurl/src/Multi.o] Error 254
make: Leaving directory `/home/musichen/dev/bitbucket/_playground/wng-backend-publisher/node_modules/lib-storage-bindings/node_modules/node-libcurl/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:269:23)
gyp ERR! stack at ChildProcess.emit (events.js:110:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:1074:12)
gyp ERR! System Linux 3.11.0-26-generic
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/musichen/dev/bitbucket/_playground/wng-backend-publisher/node_modules/lib-storage-bindings/node_modules/node-libcurl
gyp ERR! node -v v0.12.4
gyp ERR! node-gyp -v v2.0.2
gyp ERR! not ok
npm ERR! Linux 3.11.0-26-generic
npm ERR! argv "node" "/usr/local/bin/npm" "install" "node-libcurl"
npm ERR! node v0.12.4
npm ERR! npm v2.13.3
npm ERR! code ELIFECYCLE
npm ERR! [email protected] install: `node tools/retrieve-win-deps && node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node tools/retrieve-win-deps && node-gyp rebuild'.
npm ERR! This is most likely a problem with the node-libcurl package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node tools/retrieve-win-deps && node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls node-libcurl
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /home/musichen/dev/bitbucket/_playground/wng-backend-publisher/node_modules/lib-storage-bindings/node_modules/npm-debug.log
I'm working on a little project and I'm trying to authenticate with NTLM.
This is what I'm using to make the request:
var Promise = require('bluebird');
var express = require('express');
var Curl = require( 'node-libcurl' ).Curl;
function createAPIRequest(url) {
return new Promise(function(resolve, reject) {
var curl = new Curl();
curl.setOpt('URL', 'http://chum:8048/Sandbox/OData/' + url);
curl.setOpt('HTTPAUTH', Curl.auth.NTLM);
curl.setOpt('USERPWD', ''); //stuff goes in here
curl.setOpt('HTTPHEADER', ['Content-Type: application/json', 'Accept: application/json']);
curl
.on('end', function(code, body, headers) {
console.log(code);
console.log(headers);
resolve(JSON.parse(body || '{}'));
this.close();
})
.on('error', function(e) {
reject(e);
this.close();
})
.perform();
});
}
The thing is, it alternates between working and not working. Not sure if there's like some cache that needs to be cleared between requests and it's not or something. Like, it'll work and the server will return a 200, then the next request, it'll be a 401, then it'll go back to 200 and keep repeating.
The server is Microsoft Dynamics NAV 2013 R2. This only occurs in Linux using libcurl 7.40.0 or 7.32.0, but works fine under Windows using libcurl 7.40.0.
Here is what i got:
PID 2493 received SIGSEGV for address: 0x10
/srv/gdeposylka/tracker/release/543/node_modules/segfault-handler/build/Release/segfault-handler.node(+0x1cab)[0x2b6fc4001cab]
/lib/x86_64-linux-gnu/libpthread.so.0(+0xf0a0)[0x2b6fbf20c0a0]
/srv/gdeposylka/tracker/release/543/node_modules/node-libcurl/build/Release/node-libcurl.node(_ZN11NodeLibcurl5Multi21CallOnMessageCallbackEPv8CURLcode+0x96)[0x2b6fc4c31576]
/srv/gdeposylka/tracker/release/543/node_modules/node-libcurl/build/Release/node-libcurl.node(_ZN11NodeLibcurl5Multi15ProcessMessagesEv+0x4f)[0x2b6fc4c317af]
/srv/gdeposylka/tracker/release/543/node_modules/node-libcurl/build/Release/node-libcurl.node(_ZN11NodeLibcurl5Multi13HandleTimeoutEPvlS1_+0x4d)[0x2b6fc4c3186d]
/usr/lib/x86_64-linux-gnu/libcurl.so.4(+0x37ce5)[0x2b6fc4e7ace5]
/usr/lib/x86_64-linux-gnu/libcurl.so.4(curl_multi_socket_action+0x48)[0x2b6fc4e7cbb8]
/srv/gdeposylka/tracker/release/543/node_modules/node-libcurl/build/Release/node-libcurl.node(_ZN11NodeLibcurl5Multi9OnTimeoutEP10uv_timer_s+0x20)[0x2b6fc4c317e0]
/srv/gdeposylka/tracker/release/543/node_modules/node-libcurl/build/Release/node-libcurl.node(_ZN11NodeLibcurl5Multi13HandleTimeoutEPvlS1_+0x4d)[0x2b6fc4c3186d]
/usr/lib/x86_64-linux-gnu/libcurl.so.4(+0x37ce5)[0x2b6fc4e7ace5]
/usr/lib/x86_64-linux-gnu/libcurl.so.4(curl_multi_add_handle+0x21e)[0x2b6fc4e7d34e]
/srv/gdeposylka/tracker/release/543/node_modules/node-libcurl/build/Release/node-libcurl.node(_ZN11NodeLibcurl5Multi9AddHandleERKN3Nan20FunctionCallbackInfoIN2v85ValueEEE+0x1e6)[0x2b6fc4c30fb6]
/srv/gdeposylka/tracker/release/543/node_modules/node-libcurl/build/Release/node-libcurl.node(+0x137bf)[0x2b6fc4c2e7bf]
node example.js
* Hostname was NOT found in DNS cache
* Trying xxx.xxx.xxx.x...
* Connected to www.domain.com (xxx.xxx.xxx.x) port 80 (#0)
> POST /path/to/page.php HTTP/1.1
Host: www.example.com
Accept: */*
Cookie: ASPSESSIONIDCQBTDBAA=KOELADHAIBAICMIIDMLGKCDP;
ASPSESSIONIDSQCBQRRC=KBDPDOFAELNEAJKENCEGEEPM; TS0161f2e5=0141259276d9526d53def50bf1529ea5da027d962f7bfa3536fd0959bbe83f5a90d940a647
content-type: application/x-www-form-urlencoded
Content-Length: 341
everytime i run this program would display a debug message in my terminal, is there any option to hide it?
Hi,
I'm having a problem when installing the package. Previously this problem not occurred: about 1 month ago. Can you Help me, pls. It's really important and I hurry that works in PRODUCTION.
Tnx and regards.
npm WARN engine [email protected]: wanted: {"node":">= 0.8.0"} (current: {"node":"0.13.0-pre","npm":"2.7.4"})
[email protected] install /var/www/kinder/microsite/backend/node_modules/node-libcurl
node tools/retrieve-win-deps && node tools/generate-stubs && node-gyp rebuild
Cannot find curl's header file.
npm ERR! Linux 3.13.0-45-generic
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install"
npm ERR! node v0.13.0-pre
npm ERR! npm v2.7.4
npm ERR! code ELIFECYCLE
npm ERR! [email protected] install: node tools/retrieve-win-deps && node tools/generate-stubs && node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node tools/retrieve-win-deps && node tools/generate-stubs && node-gyp rebuild'.
npm ERR! This is most likely a problem with the node-libcurl package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node tools/retrieve-win-deps && node tools/generate-stubs && node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls node-libcurl
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /var/www/kinder/microsite/backend/npm-debug.log
[Exit 1]
Hi,
I just installed the latest nodejs, and libcurl, and had this error :
"5869 error Windows_NT 6.1.7601
5870 error argv "D:\programmes\nodejs\node.exe" "D:\programmes\nodejs\node_modules\npm\bin\npm-cli.js" "install" "node-libcurl"
5871 error node v0.12.7
5872 error npm v2.11.3
5873 error code ELIFECYCLE
5874 error [email protected] install: node tools/retrieve-win-deps && node tools/generate-stubs && pangyp rebuild
5874 error Exit status 1
5875 error Failed at the [email protected] install script 'node tools/retrieve-win-deps && node tools/generate-stubs && pangyp rebuild'.
5875 error This is most likely a problem with the node-libcurl package,
5875 error not with npm itself."
The complete log is here http://jpst.it/Ba8O.
Thank you for your help !
Best regards,
Anthony
Attempting to install with node v0.10.35 I get the following errors:
> [email protected] install /Users/james/path-to-my-project/node_modules/node-libcurl
> node tools/retrieve-win-deps && node tools/generate-stubs && node-gyp rebuild
CXX(target) Release/obj.target/node-libcurl/src/node-libcurl.o
CXX(target) Release/obj.target/node-libcurl/src/Curl.o
In file included from ../src/Curl.cc:11:
../src/generated-stubs/curlAuth.h:5:10: warning: implicit conversion from 'unsigned long' to 'int32_t' (aka 'int') changes value from 18446744073709551599 to -17
[-Wconstant-conversion]
{"ANY", CURLAUTH_ANY},
~ ^~~~~~~~~~~~
/usr/include/curl/curl.h:640:32: note: expanded from macro 'CURLAUTH_ANY'
#define CURLAUTH_ANY (~CURLAUTH_DIGEST_IE)
^~~~~~~~~~~~~~~~~~~
In file included from ../src/Curl.cc:11:
../src/generated-stubs/curlAuth.h:6:14: warning: implicit conversion from 'unsigned long' to 'int32_t' (aka 'int') changes value from 18446744073709551598 to -18
[-Wconstant-conversion]
{"ANYSAFE", CURLAUTH_ANYSAFE},
~ ^~~~~~~~~~~~~~~~
/usr/include/curl/curl.h:641:32: note: expanded from macro 'CURLAUTH_ANYSAFE'
#define CURLAUTH_ANYSAFE (~(CURLAUTH_BASIC|CURLAUTH_DIGEST_IE))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/Curl.cc:188:68: error: use of undeclared identifier 'nullptr'
Curl::ExportConstants( &authObj, curlAuth, sizeof( curlAuth ), nullptr, nullptr );
^
../src/Curl.cc:189:68: error: use of undeclared identifier 'nullptr'
Curl::ExportConstants( &httpObj, curlHttp, sizeof( curlHttp ), nullptr, nullptr );
^
../src/Curl.cc:190:71: error: use of undeclared identifier 'nullptr'
Curl::ExportConstants( &pauseObj, curlPause, sizeof( curlPause ), nullptr, nullptr );
^
../src/Curl.cc:191:83: error: use of undeclared identifier 'nullptr'
Curl::ExportConstants( &protocolsObj, curlProtocols, sizeof( curlProtocols ), nullptr, nullptr );
^
../src/Curl.cc:605:51: error: unknown class name 'false_type'; did you mean '__false_type'?
template <typename> struct ResultCanBeNull : std::false_type {};
^~~~~~~~~~
__false_type
/usr/include/c++/4.2.1/bits/cpp_type_traits.h:98:10: note: '__false_type' declared here
struct __false_type { };
^
../src/Curl.cc:606:50: error: unknown class name 'true_type'; did you mean '__true_type'?
template <> struct ResultCanBeNull<char*> : std::true_type {};
^~~~~~~~~
__true_type
/usr/include/c++/4.2.1/bits/cpp_type_traits.h:97:10: note: '__true_type' declared here
struct __true_type { };
^
../src/Curl.cc:623:40: error: no member named 'value' in 'ResultCanBeNull<char *>'
if ( ResultCanBeNull<TResultType>::value && !result ) //null pointer
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
../src/Curl.cc:1057:24: note: in instantiation of function template specialization 'Curl::GetInfoTmpl<char *, v8::String>' requested here
retVal = Curl::GetInfoTmpl<char*, v8::String>( *(obj), infoId );
^
../src/Curl.cc:623:40: error: no member named 'value' in 'ResultCanBeNull<long>'
if ( ResultCanBeNull<TResultType>::value && !result ) //null pointer
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
../src/Curl.cc:1062:24: note: in instantiation of function template specialization 'Curl::GetInfoTmpl<long, v8::Integer>' requested here
retVal = Curl::GetInfoTmpl<long, v8::Integer>( *(obj), infoId );
^
../src/Curl.cc:623:40: error: no member named 'value' in 'ResultCanBeNull<double>'
if ( ResultCanBeNull<TResultType>::value && !result ) //null pointer
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
../src/Curl.cc:1067:24: note: in instantiation of function template specialization 'Curl::GetInfoTmpl<double, v8::Number>' requested here
retVal = Curl::GetInfoTmpl<double, v8::Number>( *(obj), infoId );
^
2 warnings and 9 errors generated.
make: *** [Release/obj.target/node-libcurl/src/Curl.o] Error 1
The original intent of the cURL callbacks CURLOPT_HEADERFUNCTION and CURLOPT_WRITEFUNCTION was to give the user the option to return an integer indicating an error status. Thus, one could terminate a transfer early if an unexpected header appeared from the server or some bad data appeared. This is one thing that the original node-curl actually got right.
What you have done is used the EventEmitter API instead, which does not allow the user to give this feedback back to the cURL API. I respect "nodifying" cURL and using these standard classes, it but you are losing part of the original API in the process. And unfortunately that breaks my existing code.
Is it really your intention to just return chunk.length in Curl.prototype._onHeader no matter what?
When using NPM to install the package, I get this error...
[TheGrisk@Zachery-DeLong-DC] NodeJSCurl $ npm update
[email protected] node_modules/http-server/node_modules/portfinder/node_modules/mkdirp/node_modules/minimist
[email protected] node_modules/http-server/node_modules/optimist/node_modules/minimist
[email protected] node_modules/http-server/node_modules/union/node_modules/qs
[TheGrisk@Zachery-DeLong-DC] NodeJSCurl $ npm install node-libcurl
/
> [email protected] install /Users/TheGrisk/Development/tmp/NodeJSCurl/node_modules/node-libcurl
> node tools/retrieve-win-deps && node tools/generate-stubs && node-gyp rebuild
Cannot find curl's header file.
npm ERR! Darwin 14.1.0
npm ERR! argv "node" "/usr/local/bin/npm" "install" "node-libcurl"
npm ERR! node v0.12.0
npm ERR! npm v2.5.1
npm ERR! code ELIFECYCLE
npm ERR! [email protected] install: `node tools/retrieve-win-deps && node tools/generate-stubs && node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node tools/retrieve-win-deps && node tools/generate-stubs && node-gyp rebuild'.
npm ERR! This is most likely a problem with the node-libcurl package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node tools/retrieve-win-deps && node tools/generate-stubs && node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls node-libcurl
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/TheGrisk/Development/tmp/NodeJSCurl/npm-debug.log
Has anyone else seen this issue?
Cannot find curl's header file.
npm ERR! [email protected] install: `node tools/retrieve-win-deps && node tools/generate-stubs && node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the node-libcurl package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node tools/retrieve-win-deps && node tools/generate-stubs && node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls node-libcurl
npm ERR! There is likely additional logging output above.
npm ERR! System Darwin 14.0.0
npm ERR! command "/Users/newscred/.nvm/v0.10.26/bin/node" "/Users/newscred/.nvm/v0.10.26/bin/npm" "install" "node-libcurl" "--save"
npm ERR! cwd /Users/newscred/Desktop/instagram_node
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.3
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/newscred/Desktop/instagram_node/npm-debug.log
npm ERR! not ok code 0
Have you considered providing this as a cli utility that basically works like curl? (could install with two names, say ncurl
and curl
to avoid conflicts). I was thinking about this because installing curl on windows isn't the best experience, but you'd need it to run nodejs/node core tests.
Care for a PR? Alternatively I'd just write some module for it.
Would it be possible to update libcurl to 7.40?
this is the code i'm using
var Curl = require('node-libcurl').Curl
var curl = new Curl()
curl.setOpt(Curl.option.URL, "http://www1.bloomingdales.com/shop/product/mac-powder-blush-wash-dry-collection?ID=1371879")
curl.setOpt(Curl.option.FOLLOWLOCATION, true)
curl.setOpt(Curl.option.COOKIEJAR, "cookie.jar")
curl.setOpt(Curl.option.COOKIEFILE, "cookie.jar")
curl.on('end', function(statusCode, body, headers) {
console.log(body)
})
curl.perform()
here is what I got in the title tag:
M�A�C Powder Blush, Wash & Dry Collection | Bloomingdale's
however when I use curl:
curl -XGET -L http://www1.bloomingdales.com/shop/product/mac-powder-blush-wash-dry-collection?ID=1371879 -c cookie.jar
I get the title with the right encoding:
M·A·C Powder Blush, Wash & Dry Collection | Bloomingdale's
tested on: [email protected] and [email protected]
system libcurl version: curl 7.29.0
master branch should be default branch because develop is only at 0.4.0, and master is at 0.4.1
This example https://github.com/JCMais/node-libcurl/blob/develop/examples/multi-interface.js shows how to get the status code, but how to get the response body?
I'm using NodeJS.
I have array of IPs and want to check if every of them is available. I made it just doing simple request and responce.statusCode === 200 ? "Available" : "Not available"
How should I do it with your node-libcurl module?
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No license field.
npm WARN engine [email protected]: wanted: {"node":">= 0.10.0 && <= 0.12","iojs":">= 1.0.0"} (current: {"node":"4.1.0","npm":"2.14.3"})
npm WARN deprecated [email protected]: use node-gyp@3+, it does all the things
\
[email protected] install /Applications/xxx/node_modules/node-libcurl
node tools/retrieve-win-deps && node tools/generate-stubs && pangyp rebuild
gyp: /Users/xxx/.node-gyp/4.1.0/common.gypi not found (cwd: /Applications/MAMP/htdocs/mvc/node_modules/node-libcurl) while reading includes of binding.gyp while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: gyp
failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/Applications/MAMP/htdocs/mvc/node_modules/node-libcurl/node_modules/pangyp/lib/configure.js:346:16)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Darwin 14.3.0
gyp ERR! command "/usr/local/bin/node" "/Applications/MAMP/htdocs/mvc/node_modules/node-libcurl/node_modules/.bin/pangyp" "rebuild"
gyp ERR! cwd /Applications/MAMP/htdocs/mvc/node_modules/node-libcurl
gyp ERR! node -v v4.1.0
gyp ERR! pangyp -v v2.3.2
gyp ERR! not ok
npm ERR! Darwin 14.3.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "node-libcurl"
npm ERR! node v4.1.0
npm ERR! npm v2.14.3
npm ERR! code ELIFECYCLE
npm ERR! [email protected] install: node tools/retrieve-win-deps && node tools/generate-stubs && pangyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node tools/retrieve-win-deps && node tools/generate-stubs && pangyp rebuild'.
npm ERR! This is most likely a problem with the node-libcurl package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node tools/retrieve-win-deps && node tools/generate-stubs && pangyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls node-libcurl
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /Applications/MAMP/htdocs/mvc/npm-debug.log
Got the following error ELIFECYCLE when trying to install (Windows 7)
npm error log here: https://gist.github.com/codehero/3c10745f86c7b3905276
Hi
I installed but not working. It throws error saying "/lib64/libc.so.6: version `GLIBC_2.14' not found"
OS: Centos 6.7 Final
glibc 2.12
gcc (GCC) 4.8.2 20140120 (Red Hat 4.8.2-15)
Is there any way to make this work on centos 6.7. Because no way to upgrade glibc to 2.14, as we hosted on dedicated server and the data center not support to upgrade to centos 7
Hello,
first of all, thanks for amazing module!
I pretty enjoy it and everything works awesome until I try to do some things in Node debugger.
Consider the following trivial snippet (test.js
):
var Curl = require('node-libcurl').Curl;
var curl = new Curl();
debugger;
Run it in debugger mode:
$ node debug test.js
And after pressing c
to continue, get stopped at the breakpoint. Type repl
+ Enter
, get into REPL console.
Type curl
and hit Enter
, and get the error:
node: ../node_modules/nan/nan_object_wrap.h:33: static T* Nan::ObjectWrap::Unwrap(v8::Local<v8::Object>) [with T = NodeLibcurl::Easy]: Assertion `object->InternalFieldCount() > 0' failed.
program terminated
I guess it happens because debugger tries to obtain some internal structure of the Curl
instance.
Also, that does not reproduce if I start in REPL from the very beginning:
$ node
> new (require('node-libcurl').Curl)()
Curl {
domain:
Domain {
domain: null,
_events: { error: [Function] },
_eventsCount: 1,
_maxListeners: undefined,
members: [] },
_events: {},
_eventsCount: 0,
_maxListeners: undefined,
_handle: Easy { onData: [Function: bound ], onHeader: [Function: bound ] },
_id: 1,
_chunks: [],
_headerChunks: [],
_chunksLength: 0,
_headerChunksLength: 0,
_isRunning: false,
_features: 0,
onData: null,
onHeader: null }
Thanks.
My system:
Linux 3.16.0-4-586 #1 Debian 3.16.7-ckt25-2 (2016-04-08) i686 GNU/Linux
I'm having the following problem when I try to install node-libcurl
Can someone help me?
Thank you!
root@Homologacao-telemetria:/var/www/html/socket-server# npm install node-libcurl --safe
[email protected] install /var/www/html/socket-server/node_modules/node-libcurl
node-pre-gyp install --fallback-to-build
gyp WARN EACCES user "root" does not have permission to access the dev dir "/root/.node-gyp/5.11.0"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/var/www/html/socket-server/node_modules/node-libcurl/.node-gyp"
make: Entering directory '/var/www/html/socket-server/node_modules/node-libcurl/build'
make: *** No rule to make target '../.node-gyp/5.11.0/include/node/common.gypi', needed by 'Makefile'. Pare.
make: Leaving directory '/var/www/html/socket-server/node_modules/node-libcurl/build'
gyp ERR! build error
gyp ERR! stack Error: make
failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/var/www/html/socket-server/node_modules/node-gyp/lib/build.js:276:23)
gyp ERR! stack at emitTwo (events.js:100:13)
gyp ERR! stack at ChildProcess.emit (events.js:185:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:204:12)
gyp ERR! System Linux 3.16.0-4-586
gyp ERR! command "/opt/node/bin/node" "/var/www/html/socket-server/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/var/www/html/socket-server/node_modules/node-libcurl/lib/binding/node_libcurl.node" "--module_name=node_libcurl" "--module_path=/var/www/html/socket-server/node_modules/node-libcurl/lib/binding"
gyp ERR! cwd /var/www/html/socket-server/node_modules/node-libcurl
gyp ERR! node -v v5.11.0
gyp ERR! node-gyp -v v3.3.1
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/opt/node/bin/node /var/www/html/socket-server/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/var/www/html/socket-server/node_modules/node-libcurl/lib/binding/node_libcurl.node --module_name=node_libcurl --module_path=/var/www/html/socket-server/node_modules/node-libcurl/lib/binding' (1)
node-pre-gyp ERR! stack at ChildProcess. (/var/www/html/socket-server/node_modules/node-libcurl/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at emitTwo (events.js:100:13)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:185:7)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:850:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5)
node-pre-gyp ERR! System Linux 3.16.0-4-586
node-pre-gyp ERR! command "/opt/node/bin/node" "/var/www/html/socket-server/node_modules/node-libcurl/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /var/www/html/socket-server/node_modules/node-libcurl
node-pre-gyp ERR! node -v v5.11.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.13
node-pre-gyp ERR! not ok
Failed to execute '/opt/node/bin/node /var/www/html/socket-server/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/var/www/html/socket-server/node_modules/node-libcurl/lib/binding/node_libcurl.node --module_name=node_libcurl --module_path=/var/www/html/socket-server/node_modules/node-libcurl/lib/binding' (1)
/var/www/html/socket-server
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected]
npm WARN enoent ENOENT: no such file or directory, open '/var/www/html/socket-server/package.json'
npm WARN socket-server No description
npm WARN socket-server No repository field.
npm WARN socket-server No README data
npm WARN socket-server No license field.
npm ERR! Linux 3.16.0-4-586
npm ERR! argv "/opt/node/bin/node" "/opt/node/bin/npm" "install" "node-libcurl" "--safe"
npm ERR! node v5.11.0
npm ERR! npm v3.8.6
npm ERR! code ELIFECYCLE
npm ERR! [email protected] install: node-pre-gyp install --fallback-to-build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-pre-gyp install --fallback-to-build'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the node-libcurl package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-pre-gyp install --fallback-to-build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs node-libcurl
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls node-libcurl
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /var/www/html/socket-server/npm-debug.log
root@Homologacao-telemetria:/var/www/html/socket-server#
Hi,
Using Node version v0.10.23
When i run this command:
npm install node-libcurl
i get the following error:
Cannot find curl's header file.
npm ERR! [email protected] install: node tools/retrieve-win-deps && node tools/generate-stubs && node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the node-libcurl package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node tools/retrieve-win-deps && node tools/generate-stubs && node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls node-libcurl
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 3.8.0-34-generic
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install"
npm ERR! cwd /var/www/piggybaq
npm ERR! node -v v0.10.23
npm ERR! npm -v 1.3.17
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /var/www/piggybaq/npm-debug.log
npm ERR! not ok code 0
Hi, I'm trying to set option curl.setOpt( 'CURLOPT_HTTPHEADER', ['Host: ' + frontend]);
, where frontend
is front end IP. But 'end' or 'error' handlers are not invoked. Any thoughts how to set host in header?
Which opts provides --insecure flag
WIN7 X64
Node 0.12.13 X32
Python 2.7 - OK
Visual Studio 2013 - OK
git - OK
npm install nw-gyp -g - OK
npm install node-libcurl --runtime=node-webkit --target=0.12.3 --arch=ia32 --msvs_version=2013 --build-from-source --save
console error:
gyp: conditions target_arch=="arm" must be length 2 or 3, not 17
debug-log error:
14804 error Windows_NT 6.1.7601
14805 error argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install" "node-libcurl" "--runtime=node-webkit" "--target=0.12.3" "--arch=ia32" "--msvs_version=2013" "--build-from-source" "--save"
14806 error node v0.12.13
14807 error npm v2.15.0
14808 error code ELIFECYCLE
Editing file deps\curl-for-windows\openssl\openssl.gyp
removes mentioned error, goes further with building but fails with many errors.
Error: Command failed: C:\Windows\system32\cmd.exe /s /c "git init -q && git submodule add https://github.com/JCMais/curl-for-windows.git deps/curl-for-windows"
'deps/curl-for-windows' already exists and is not a valid git repo
When using:
npm install node-libcurl
builds OK, work OK in node, not working in nwjs (Module version mismatch. Expected 43, got 14)
On Mac & Linux (Debian Ubuntu) same command builds and work OK for nwjs.
Can anybody compile and upload node_libcurl-v0.9.0-node-v43-win32-ia32.tar.gz
Hi
If the path has spaces, the installation fails --- at least on OSX. Here's an example:
npm install node-libcurl
Gives this output:
[email protected] install /Users/myusername/installfolder (with spaces)/lambda/examplefolder/node_modules/node-libcurl
node tools/retrieve-win-deps && node tools/generate-stubs && node-gyp rebuild
/bin/sh: -c: line 0: syntax error near unexpected token (' /bin/sh: -c: line 0:
node /Users/myusername/installfolder (with spaces)/lambda/examplefolder/node_modules/node-libcurl/tools/curl-config.js'
gyp: Call to 'node /Users/myusername/installfolder (with spaces)/lambda/examplefolder/node_modules/node-libcurl/tools/curl-config.js' returned exit status 2. while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: gyp
failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:343:16)
gyp ERR! stack at ChildProcess.emit (events.js:110:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:1074:12)
gyp ERR! System Darwin 14.3.0
Hi,
I am getting error on rebuilding with node v0.12.7 and npm v2.11.3. The logs are as -
npm install node-libcurl
npm WARN engine [email protected]: wanted: {"node":">= 0.10.0 && <= 0.12","iojs":">= 1.0.0"} (current: {"node":"0.12.7","npm":"2.11.3"})
[email protected] install /home/mz/temp_moz/node_modules/node-libcurl
node tools/retrieve-win-deps && node tools/generate-stubs && pangyp rebuild
Cannot find curl's header file.
npm ERR! Linux 3.13.0-24-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "node-libcurl"
npm ERR! node v0.12.7
npm ERR! npm v2.11.3
npm ERR! code ELIFECYCLE
npm ERR! [email protected] install: node tools/retrieve-win-deps && node tools/generate-stubs && pangyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node tools/retrieve-win-deps && node tools/generate-stubs && pangyp rebuild'.
npm ERR! This is most likely a problem with the node-libcurl package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node tools/retrieve-win-deps && node tools/generate-stubs && pangyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls node-libcurl
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /home/mz/temp_moz/node_modules/npm-debug.log
Hi,
Have you implemented NTLM authentication for exchange in this project?
When i am trying to use setOpt as below i am getting error. However it's mentioned here - http://curl.haxx.se/libcurl/c/curl_easy_setopt.html
curl.setOpt('IPRESOLVE', 1);
curl.setOpt('ACCEPT_ENCODING', 1);
curl.setOpt('SSLVERSION', 1);
Hello,
Making a request to a https website (i tried https://www.google.com, https://yahoo.com) doesn't work while i'm using a http proxy (i tried some from the hidemyass list). The proxy works using curl (curl --proxy $PROXY https://google.com). Also I can use node-libcurl with a proxy on a http website. Also a socks5 proxy works on a https website. I just can't get a http proxy to work.
Let me know if I wasn't clear enough. I'm pretty bad at explaining bugs.
Hi
i'm using Centos 6.6(Final), when using module i got the following error :
Error: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by /root/node_modules/node-libcurl/lib/binding/node_libcurl.node)
Got this error while doing npm update on nodejs 0.12.1 and 0.12.7
/
> [email protected] install /home/druidvav/tracker/node_modules/curl-browser/node_modules/node-libcurl
> node tools/retrieve-win-deps && node-gyp rebuild
child_process: customFds option is deprecated, use stdio instead.
make: Entering directory `/home/druidvav/tracker/node_modules/curl-browser/node_modules/node-libcurl/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
../src/Multi.cc: In lambda function:
../src/Multi.cc:32:160: error: ‘this’ was not captured for this lambda function
make: *** [Release/obj.target/node-libcurl/src/Multi.o] Error 1
make: Leaving directory `/home/druidvav/tracker/node_modules/curl-browser/node_modules/node-libcurl/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.