libcurl bindings for Node.js

Overview

node-libcurl

Buy Me A Coffee
Patreon Logo
Discord Logo

NPM version license Dependencies

Travis CI Status AppVeyor CI Status Code Quality

The fastest URL transfer library for Node.js.

libcurl bindings for Node.js. libcurl official description:

libcurl is a free and easy-to-use client-side URL transfer library, supporting DICT, FILE, FTP, FTPS, Gopher, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, POP3, POP3S, RTMP, RTSP, SCP, SFTP, SMTP, SMTPS, Telnet and TFTP. libcurl supports SSL certificates, HTTP POST, HTTP PUT, FTP uploading, HTTP form based upload, proxies, cookies, user+password authentication (Basic, Digest, NTLM, Negotiate, Kerberos), file transfer resume, http proxy tunneling and more!

Quick Start

Install

npm i node-libcurl --save

or

yarn add node-libcurl

Simple Request - Async / Await using curly

this API is experimental and is subject to changes without a major version bump

const { curly } = require('node-libcurl');

const { statusCode, data, headers } = await curly.get('http://www.google.com')

Any option can be passed using their FULLNAME or a lowerPascalCase format:

const querystring = require('querystring');
const { curly } = require('node-libcurl');

const { statusCode, data, headers } = await curly.post('http://httpbin.com/post', {
  postFields: querystring.stringify({
    field: 'value',
  }),
  // can use `postFields` or `POSTFIELDS`
})

JSON POST example:

const { curly } = require('node-libcurl')
const { data } = await curly.post('http://httpbin.com/post', {
  postFields: JSON.stringify({ field: 'value' }),
  httpHeader: [
    'Content-Type: application/json',
    'Accept: application/json'
  ],
})

console.log(data)

Simple Request - Using Curl class

const { Curl } = require('node-libcurl');

const curl = new Curl();

curl.setOpt('URL', 'www.google.com');
curl.setOpt('FOLLOWLOCATION', true);

curl.on('end', function (statusCode, data, headers) {
  console.info(statusCode);
  console.info('---');
  console.info(data.length);
  console.info('---');
  console.info(this.getInfo( 'TOTAL_TIME'));
  
  this.close();
});

curl.on('error', curl.close.bind(curl));
curl.perform();

Setting HTTP headers

Pass an array of strings specifying headers

curl.setOpt(Curl.option.HTTPHEADER,
  ['Content-Type: application/x-amz-json-1.1'])

Form Submission (Content-Type: application/x-www-form-urlencoded)

const querystring = require('querystring');
const { Curl } = require('node-libcurl');

const curl = new Curl();
const close = curl.close.bind(curl);

curl.setOpt(Curl.option.URL, '127.0.0.1/upload');
curl.setOpt(Curl.option.POST, true)
curl.setOpt(Curl.option.POSTFIELDS, querystring.stringify({
  field: 'value',
}));

curl.on('end', close);
curl.on('error', close);

MultiPart Upload / HttpPost libcurl Option (Content-Type: multipart/form-data)

const { Curl } = require('node-libcurl');

const curl = new Curl();
const close = curl.close.bind(curl);

curl.setOpt(Curl.option.URL, '127.0.0.1/upload.php');
curl.setOpt(Curl.option.HTTPPOST, [
    { name: 'input-name', file: '/file/path', type: 'text/html' },
    { name: 'input-name2', contents: 'field-contents' }
]);

curl.on('end', close);
curl.on('error', close);

Binary Data

When requesting binary data make sure to do one of these:

curl.setOpt('WRITEFUNCTION', (buffer, size, nmemb) => {
  // something
})
  • Enable one of the following flags:
curl.enable(CurlFeature.NoDataParsing)
// or
curl.enable(CurlFeature.Raw)

The reasoning behind this is that by default, the Curl instance will try to decode the received data and headers to utf8 strings, as can be seen here: https://github.com/JCMais/node-libcurl/blob/b55b13529c9d11fdcdd7959137d8030b39427800/lib/Curl.ts#L391

For more examples check the examples folder.

API

API documentation for the latest stable version is available at https://node-libcurl-docs.netlify.app/modules/lib_index.html.

Develop branch documentation is available at https://develop--node-libcurl-docs.netlify.app/modules/lib_index.html.

This library provides Typescript type definitions.

Almost all CURL options are supported, if you pass one that is not, an error will be thrown.

For more usage examples check the examples folder.

Special Notes

READFUNCTION option

The buffer passed as first parameter to the callback set with the READFUNCTION option is initialized with the size libcurl is using in their upload buffer (which can be set with UPLOAD_BUFFERSIZE), this is initialized using node::Buffer::Data(buf); which is basically the same than Buffer#allocUnsafe and therefore, it has all the implications as to its correct usage: https://nodejs.org/pt-br/docs/guides/buffer-constructor-deprecation/#regarding-buffer-allocunsafe

So, be careful, make sure to return exactly the amount of data you have written to the buffer on this callback. Only that specific amount is going to be copied and handed over to libcurl.

Common Issues

See COMMON_ISSUES.md

Benchmarks

See ./benchmark

Security

See SECURITY.md

Supported Libcurl Versions

The addon is only tested against libcurl version 7.50.0 and the latest one available.

The code itself is made to compile with any version greater than 7.32.0, any libcurl version lower than that is not supported.

For Enterprise

node-libcurl is available as part of the Tidelift Subscription.

The maintainers of node-libcurl and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. Learn more.

Detailed Installation

The latest version of this package has prebuilt binaries (thanks to node-pre-gyp) available for:

  • Node.js: Latest two versions on active LTS (see https://github.com/nodejs/Release)
  • Electron: Latest 3 major versions
  • NW.js (node-webkit): Latest 3 major (minor for nw.js case) versions

And on the following platforms:

  • Linux 64 bits
  • Mac OS X 64 bits
  • Windows 32 and 64 bits

Installing with yarn add node-libcurl or npm install node-libcurl should download a prebuilt binary and no compilation will be needed. However if you are trying to install on nw.js or electron additional steps will be required, check their corresponding section below.

The prebuilt binary is statically built with the following library versions, features and protocols (library versions may change between Node.js versions):

Version: libcurl/7.73.0 OpenSSL/1.1.1g zlib/1.2.11 brotli/1.0.7 zstd/1.4.9 c-ares/1.16.1 libidn2/2.1.1 libssh2/1.9.0 nghttp2/1.41.0
Protocols: dict, file, ftp, ftps, gopher, http, https, imap, imaps, ldap, ldaps, mqtt, pop3, pop3s, rtsp, scp, sftp, smb, smbs, smtp, smtps, telnet, tftp
Features: AsynchDNS, IDN, IPv6, Largefile, NTLM, NTLM_WB, SSL, libz, brotli, TLS-SRP, HTTP2, UnixSockets, HTTPS-proxy

If there is no prebuilt binary available that matches your system, or if the installation fails, then you will need an environment capable of compiling Node.js addons, which means:

If you don't want to use the prebuilt binary even if it works on your system, you can pass a flag when installing:

With npm

npm install node-libcurl --build-from-source

With yarn

npm_config_build_from_source=true yarn add node-libcurl

Important Notes on Prebuilt Binaries / Direct Installation

Those notes are not important when building on Windows

The prebuilt binaries are statically linked with brotli, libidn2, libssh2, openLDAP, OpenSSL nghttp2, zstd and zlib.

The brotli, nghttp2, OpenSSL and zlib versions must match the version Node.js uses, this is necessary to avoid any possible issues by mixing library symbols of different versions, since Node.js also exports some of the symbols of their deps.

In case you are building the addon yourself with the libraries mentioned above, you must make sure their version is ABI compatible with the one Node.js uses, otherwise you are probably going to hit a Segmentation Fault.

If you want to build a statically linked version of the addon yourself, you need to pass the curl_static_build=true flag when calling install.

If using npm:

npm install node-libcurl --build-from-source --curl_static_build=true

If using yarn:

npm_config_build_from_source=true npm_config_curl_static_build=true yarn add node-libcurl

The build process will use curl-config available on path, if you want to overwrite it to your own libcurl installation one, you can set the curl_config_bin variable, like mentioned above for curl_static_build.

And if you don't want to use curl-config, you can pass two extra variables to control the build process:

  • curl_include_dirs Space separated list of directories to search for header files
  • curl_libraries Space separated list of flags to pass to the linker

Missing Packages

The statically linked version currently does not have support for GSS-API, SPNEGO, KERBEROS, RTMP, Metalink, PSL and Alt-svc.

The scripts to build Kerberos exists on the ./scripts/ci folder, but it was removed for two reasons:

  • If built with Heimdal, the addon becomes too big
  • If built with MIT Kerberos, the addon would be bound to their licensing terms.

Electron / NW.js

If building for a Electron or NW.js you need to pass additional parameters to the install command.

If you do not want to use the prebuilt binary, pass the npm_config_build_from_source=true / --build-from-source flag to the install command.

NW.js (aka node-webkit)

For building from source on NW.js you first need to make sure you have nw-gyp installed globally: yarn global add nw-gyp or npm i -g nw-gyp

If on Windows, you also need addition steps, currently the available win_delay_load_hook.cc on nw-gyp is not working with this addon, so it's necessary to apply a patch to it. The patch can be found on ./scripts/ci/patches/win_delay_load_hook.cc.patch, and should be applied to the file on /src/win_delay_load_hook.cc.

Then:

yarn

npm_config_runtime=node-webkit npm_config_target=0.38.2 yarn add node-libcurl

npm

npm install node-libcurl --runtime=node-webkit --target=0.38.2 --save

where --target is the current version of NW.js you are using

Electron (aka atom-shell)

yarn

npm_config_runtime=electron npm_config_target=$(yarn --silent electron --version) npm_config_disturl=https://www.electronjs.org/headers yarn add node-libcurl

npm

npm install node-libcurl --runtime=electron --target=$(yarn --silent electron --version) --disturl=https://www.electronjs.org/headers --save

Where --target is the version of electron you are using, in our case, we are just using the version returned by the locally installed electron binary.

You can also put those args in a .npmrc file, like so:

runtime = electron
target = 5.0.1
target_arch = x64
dist_url = https://atom.io/download/atom-shell

Electron >= 11 / NW.js >= 0.50

If you are building for Electron >= 11 or NW.js >= 0.50 you need to set the build process to use the C++17 std, you can do that by passing the variable node_libcurl_cpp_std=c++17. The way you do that depends if you are using npm or yarn:

If using npm:

npm install node-libcurl --build-from-source --node_libcurl_cpp_std=c++17

If using yarn:

npm_config_build_from_source=true npm_config_node_libcurl_cpp_std=c++17 yarn add node-libcurl

Building on Linux

To build the addon on linux based systems you must have:

  • gcc >= 4.8
  • libcurl dev files
  • python 2.7

If you are on a debian based system, you can get those by running:

sudo apt-get install python libcurl4-openssl-dev build-essential

If you don't want to use the libcurl version shipped with your system, since it's probably very old, you can install libcurl from source, for the addon to use that libcurl version you can use the variable mentioned above, curl_config_bin.

In case you want some examples check the CI configuration files (.travis.yml, .circleci/config.yml) and the scripts/ci/ folder.

Building on macOS

On macOS you must have:

  • macOS >= 10.12 (Sierra)
  • Xcode Command Line Tools

You can check if you have Xcode Command Line Tools be running:

xcode-select -p

It should return their path, in case it returns nothing, you must install it by running:

xcode-select --install

Xcode >= 10 | macOS >= Mojave

In case you have errors installing the addon from source, and you are using macOS version >= Mojave, check if the error you are receiving is the following one:

  CXX(target) Release/obj.target/node_libcurl/src/node_libcurl.o
  clang: error: no such file or directory: '/usr/include'

If that is the case, it's because newer versions of the Command Line Tools does not add the /usr/include folder by default. Check Xcode 10 release notes for details.

The /usr/include is now available on $(xcrun --show-sdk-path)/usr/include. To correctly build libcurl you then need to pass that path to the npm_config_curl_include_dirs environment variable:

npm_config_curl_include_dirs="$(xcrun --show-sdk-path)/usr/include" yarn add node-libcurl

Building on Windows

If installing using a prebuilt binary you only need to have the visual c++ 2017 runtime library.

If building from source, you must have:

Python 2.7 and the Visual Studio compiler can be installed by running:

npm install --global --production windows-build-tools

nasm can be obtained from their website, which is linked above, or using chocolatey:

cinst nasm

Currently there is no support to use other libcurl version than the one provided by the curl-for-windows submodule (help is appreciated on adding this feature).

An important note about building the addon on Windows is that we have to do some "hacks" with the header files included by node-gyp/nw-gyp. The reason for that is because as we are using a standalone version of OpenSSL, we don't want to use the OpenSSL headers provided by Node.js, which are by default added to /include/node/openssl, so what we do is that before compilation that folder is renamed to openssl.disabled. After a successful installation the folder is renamed back to their original name, however if any error happens during compilation the folder will stay renamed until the addon is compiled successfully. More info on why that was needed and some context can be found on issue #164.

Getting Help

If your question is directly related to the addon or their usage, you can get help the following ways:

  • Post a question on stack-overflow and use the node-libcurl tag.
  • Join our Discord server and send your question there.

Contributing

Read CONTRIBUTING.md

Donations / Patreon

Some people have been asking if there are any means to support my work, I've created a patreon page for that: https://www.patreon.com/jonathancardoso

If you want to donate via PayPal, use the same e-mail that is available on my GitHub profile: https://github.com/JCMais

And thanks for reading till here! 😄

Originally this addon was based on the work from jiangmiao/node-curl, things have changed and most if not all code has been rewritten.

Comments
  • Getting error while using Node v4.2.4

    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!

    build-error darwin 
    opened by angelinetran 36
  • `Curl` call wrapped within a Promise makes mocha not finishing test cases.

    `Curl` call wrapped within a Promise makes mocha not finishing test cases.

    Sorry if this is not a right place but I'm looping with a debugger for hours already and I think I am out of ideas of what can be wrong.

    tldr; testing with mocha is highly unreliable, usually times out

    Longer story

    I'm using this package for a long time and first I'd like to thank all the contributors for amazing work you do. Thank you.

    Today I decided to update my small library by bumping node-libcurl to latest version.

    I have small regression/integration test and I found most of them (sometimes all) fail after upgrade with no good reason.

    I spent hours trying to detect the issue in my code but I'm pretty sure there is some bug in this code.

    I've made a smallest as possible test to prove that: https://github.com/sznowicki/uptime-check/blob/node-libcurl-2/test/node-libcurl-issue-test.js

    In this file you'll find three test cases: curl pure implementation, curl wrapped in a promise and called in traditional way, same wrapped curl called in async/await way.

    While pure implementation always succeeds (also tried placing it last), Promise.then always times out, async/await usually times out but sometimes is surprisingly green (slow though).

    To be honest, I don't have a good idea why this package would cause this behaviour from mocha, but I did try many ways of testing that to exclude other possibilities.

    It just feels like something either overrides mocha's "done/await" checks.

    On way of testing was to resolve early, before Curl is involved and this made the tests finishing again (also included in the test cases I posted). And I think this is a very good reason to post this issue here and not in the mocha repo.

    If you have any questions, or concerns I promise to be active in this issue.

    If I missed something stupid and obvious, I'd like to apologise in advance.

    PS: maybe it matters: node v10.2.1

    EDIT:

    • The mentioned test is all green with [email protected]
    • my system: macOS 10.14.5
    • url used in test doesn't play any role in this, original tests were testing against a real website under my control
    bug help wanted tests 
    opened by sznowicki 31
  • Random core dumps on AWS Lambda 10.x

    Random core dumps on AWS Lambda 10.x

    Hi,

    I'm running node-libcurl on AWS Lambda Node.js 10.x and I'm getting random core dumps. So, one request completes completely normal once and then the next time it fails with a dump.

    There errors come in two parts:

    1. Some illegal pointer exception.
    llpropertylink-mainview\":free(): invalid pointer
    

    or

    free(): invalid pointer
    
    1. The default core dump message
    Runtime exited with error: signal: aborted (core dumped)
    Runtime.ExitError
    

    I compile node_libcurl.node using a Docker container called lambci/lambda:build-nodejs10.x and just copy the resulting binary to the zip used to deploy to Lambda.

    Using some debug statements, I can see that the end or error event are not emitted when there is a dump. The last thing in the logs is the curl.perform() method being called.

    The weird thing is, outside of these core dumps, it works perfectly for 90%-95% of all requests.

    segfault 
    opened by tnolet 24
  • not working on alpine

    not working on alpine

    Dockerfile

    FROM node:7.5-alpine
    RUN apk add --no-cache libcurl
    RUN npm install node-libcurl
    RUN  echo "require('node-libcurl')"|node
    

    docker build .

    ...
    module.js:598
      return process.dlopen(module, path._makeLong(filename));
                     ^
    
    Error: Error relocating /node_modules/node-libcurl/lib/binding/node_libcurl.node: __vsnprintf_chk: symbol not found
        at Object.Module._extensions..node (module.js:598:18)
        at Module.load (module.js:488:32)
        at tryModuleLoad (module.js:447:12)
        at Function.Module._load (module.js:439:3)
        at Module.require (module.js:498:17)
        at require (internal/module.js:20:19)
        at Object.<anonymous> (/node_modules/node-libcurl/lib/Easy.js:40:29)
        at Module._compile (module.js:571:32)
        at Object.Module._extensions..js (module.js:580:10)
        at Module.load (module.js:488:32)
    
    build-error *nix 
    opened by dcharbonnier 22
  • `zstd` dependency is missing

    `zstd` dependency is missing

    Error:

    Error: dlopen(node_modules/node-libcurl/lib/binding/node_libcurl.node, 1): Library not loaded: /usr/local/opt/zstd/lib/libzstd.1.dylib
    Referenced from: node_modules/node-libcurl/lib/binding/node_libcurl.node
    
    Reason: image not found
      at Object.Module._extensions..node (internal/modules/cjs/loader.js:1057:18)
      at Module.load (internal/modules/cjs/loader.js:863:32)
    

    Hot Fix

    Install zstd package

    This issue took at least 8 hour from our team 😅 Added 🔥 hotfix instruction to library where node-libcurl is dependency — https://github.com/VeliovGroup/request-extra#3-missing-libraries

    @JCMais node-libcurl expect to have zstd library installed? Or it's a bug and dependency is missing?

    Tested on [email protected] and [email protected], [email protected] and [email protected], [email protected] and [email protected].

    opened by dr-dimitru 20
  • Memory leaks!!!

    Memory leaks!!!

    var x = 0; function doA() { ++x; var c = new Curl(); c.close(); delete c; }

    function Application() { function doSchedule() { console.log(process.memoryUsage(), x); doA('a'); } setInterval(doSchedule, 1);

    return this;
    

    }

    var app = new Application();

    memory-leak 
    opened by Setitch 19
  • Update curl-for-windows to 7.54

    Update curl-for-windows to 7.54

    Hey @JCMais.

    How much work is it to update curl-for-windows to 7.54? There is a fix in 7.53 related to NTLM authentication that I would like to get access to.

    It looks like the last one was just a submodule update?

    Let me know if this is something you want to do and if there is anything I can do to help.

    question 
    opened by gschier 18
  • Segfault in 0.6.3 version

    Segfault in 0.6.3 version

    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]
    
    bug blocked cannot-reproduce 
    opened by druidvav 18
  • DNS lookups are not working with multiple system DNS servers

    DNS lookups are not working with multiple system DNS servers

    With the recent switch to the c-ares DNS resolver backend in version 2.3.0, it seems like DNS resolution is sometimes failing when using multiple DNS servers. A lot of our users have reported that they are unable to make requests due to this: https://github.com/Kong/insomnia/issues/3234.

    Do you think it would be reasonable to stop using c-ares for the prebuilt binaries, given that there are likely a lot of other issues like this compared to the built-in system resolvers, and it's not possible to disable it during runtime?

    opened by DMarby 15
  • Building node-libcurl for electron on windows

    Building node-libcurl for electron on windows

    Hi, I'm using a windows machine (x64) and I'm trying to get node-libcurl to work for my electron application, I followed the install command given in the documentation which is npm install node-libcurl --runtime=electron --target=1.0.2 --disturl=https://atom.io/download/atom-shell --arch=x64 --save and replaced the target version with the target version of electron that I was building for (in this case it was 2.0.17) and this is the error I keep getting any time I run the install command. fatal error LNK1106: invalid file or disk full: cannot seek to 0x 29851C [D:\Code\share\node_modules\node-libcurl\build\node_libcurl.vcxproj] please, can anyone help me out on this? Screenshot (181)

    build-error cannot-reproduce electron 
    opened by king-d-dev 13
  • mojave unable to install

    mojave unable to install

    [10/19] ⠂ bcrypt
    [13/19] ⠂ sharp
    [14/19] ⠂ node-libcurl
    [11/19] ⠄ sqlite3
    error /Users/quantum/Desktop/code/vendure/node_modules/node-libcurl: Command failed.
    Exit code: 1
    Command: node-pre-gyp install --fallback-to-build
    Arguments:
    Directory: /Users/quantum/Desktop/code/vendure/node_modules/node-libcurl
    Output:
    node-pre-gyp info it worked if it ends with ok
    node-pre-gyp info using [email protected]
    node-pre-gyp info using [email protected] | darwin | x64
    node-pre-gyp WARN Using request for node-pre-gyp https download
    node-pre-gyp info check checked for "/Users/quantum/Desktop/code/vendure/node_modules/node-libcurl/lib/binding/node_libcurl.node" (not found)
    node-pre-gyp http GET https://github.com/JCMais/node-libcurl/releases/download/v2.0.2/node_libcurl-v2.0.2-node-v79-darwin-x64-unknown.tar.gz
    node-pre-gyp http 404 https://github.com/JCMais/node-libcurl/releases/download/v2.0.2/node_libcurl-v2.0.2-node-v79-darwin-x64-unknown.tar.gz
    node-pre-gyp WARN Tried to download(404): https://github.com/JCMais/node-libcurl/releases/download/v2.0.2/node_libcurl-v2.0.2-node-v79-darwin-x64-unknown.tar.gz
    node-pre-gyp WARN Pre-built binaries not found for [email protected] and [email protected] (node-v79 ABI, unknown) (falling back to source compile with node-gyp)
    node-pre-gyp http 404 status code downloading tarball https://github.com/JCMais/node-libcurl/releases/download/v2.0.2/node_libcurl-v2.0.2-node-v79-darwin-x64-unknown.tar.gz
    gyp info it worked if it ends with ok
    gyp info using [email protected]
    gyp info using [email protected] | darwin | x64
    gyp info ok
    gyp info it worked if it ends with ok
    gyp info using [email protected]
    gyp info using [email protected] | darwin | x64
    gyp info find Python using Python version 2.7.16 found at "/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python"
    gyp info spawn /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
    gyp info spawn args [
    gyp info spawn args   '/Users/quantum/Desktop/code/vendure/node_modules/node-gyp/gyp/gyp_main.py',
    gyp info spawn args   'binding.gyp',
    gyp info spawn args   '-f',
    gyp info spawn args   'make',
    gyp info spawn args   '-I',
    gyp info spawn args   '/Users/quantum/Desktop/code/vendure/node_modules/node-libcurl/build/config.gypi',
    gyp info spawn args   '-I',
    gyp info spawn args   '/Users/quantum/Desktop/code/vendure/node_modules/node-gyp/addon.gypi',
    gyp info spawn args   '-I',
    gyp info spawn args   '/Users/quantum/Library/Caches/node-gyp/13.10.1/include/node/common.gypi',
    gyp info spawn args   '-Dlibrary=shared_library',
    gyp info spawn args   '-Dvisibility=default',
    gyp info spawn args   '-Dnode_root_dir=/Users/quantum/Library/Caches/node-gyp/13.10.1',
    gyp info spawn args   '-Dnode_gyp_dir=/Users/quantum/Desktop/code/vendure/node_modules/node-gyp',
    gyp info spawn args   '-Dnode_lib_file=/Users/quantum/Library/Caches/node-gyp/13.10.1/<(target_arch)/node.lib',
    gyp info spawn args   '-Dmodule_root_dir=/Users/quantum/Desktop/code/vendure/node_modules/node-libcurl',
    gyp info spawn args   '-Dnode_engine=v8',
    gyp info spawn args   '--depth=.',
    gyp info spawn args   '--no-parallel',
    gyp info spawn args   '--generator-output',
    gyp info spawn args   'build',
    gyp info spawn args   '-Goutput_dir=.'
    gyp info spawn args ]
    gyp info ok
    gyp info it worked if it ends with ok
    gyp info using [email protected]
    gyp info using [email protected] | darwin | x64
    gyp info spawn make
    gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
      CXX(target) Release/obj.target/node_libcurl/src/node_libcurl.o
    clang: error: no such file or directory: '/usr/include'
    make: *** [Release/obj.target/node_libcurl/src/node_libcurl.o] Error 1
    gyp ERR! build error
    gyp ERR! stack Error: `make` failed with exit code: 2
    gyp ERR! stack     at ChildProcess.onExit (/Users/quantum/Desktop/code/vendure/node_modules/node-gyp/lib/build.js:196:23)
    gyp ERR! stack     at ChildProcess.emit (events.js:316:20)
    gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
    gyp ERR! System Darwin 19.3.0
    gyp ERR! command "/usr/local/Cellar/node/13.10.1/bin/node" "/Users/quantum/Desktop/code/vendure/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/Users/quantum/Desktop/code/vendure/node_modules/node-libcurl/lib/binding/node_libcurl.node" "--module_name=node_libcurl" "--module_path=/Users/quantum/Desktop/code/vendure/node_modules/node-libcurl/lib/binding" "--napi_version=5" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v79"
    gyp ERR! cwd /Users/quantum/Desktop/code/vendure/node_modules/node-libcurl
    gyp ERR! node -v v13.10.1
    gyp ERR! node-gyp -v v5.0.3
    gyp ERR! not ok
    node-pre-gyp ERR! build error
    node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/Cellar/node/13.10.1/bin/node /Users/quantum/Desktop/code/vendure/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/Users/quantum/Desktop/code/vendure/node_modules/node-libcurl/lib/binding/node_libcurl.node --module_name=node_libcurl --module_path=/Users/quantum/Desktop/code/vendure/node_modules/node-libcurl/lib/binding --napi_version=5 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v79' (1)
    node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/Users/quantum/Desktop/code/vendure/node_modules/node-libcurl/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
    node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:316:20)
    node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:1026:16)
    node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
    node-pre-gyp ERR! System Darwin 19.3.0
    node-pre-gyp ERR! command "/usr/local/Cellar/node/13.10.1/bin/node" "/Users/quantum/Desktop/code/vendure/node_modules/node-libcurl/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
    node-pre-gyp ERR! cwd /Users/quantum/Desktop/code/vendure/node_modules/node-libcurl
    node-pre-gyp ERR! node -v v13.10.1
    node-pre-gyp ERR! node-pre-gyp -v v0.13.0
    node-pre-gyp ERR! not ok
    
    

    i tried to fix by

    open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg
    

    but it says

    The file /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg does not exist.
    
    build-error darwin help wanted 
    opened by shirshak55 12
Releases(v3.0.0)
Owner
Jonathan Cardoso
Full-Stack developer and DevOps specialist - Chaotic Good
Jonathan Cardoso
Promise based HTTP client for the browser and node.js

axios Promise based HTTP client for the browser and node.js New axios docs website: click here Table of Contents Features Browser Support Installing E

axios 98k Dec 31, 2022
Ajax for Node.js and browsers (JS HTTP client)

superagent Small progressive client-side HTTP request library, and Node.js module with the same API, supporting many high-level HTTP client features T

Sloth 16.2k Jan 1, 2023
A full-featured http proxy for node.js

node-http-proxy node-http-proxy is an HTTP programmable proxying library that supports websockets. It is suitable for implementing components such as

http ... PARTY! 13.1k Jan 3, 2023
HTTP server mocking and expectations library for Node.js

Nock HTTP server mocking and expectations library for Node.js Nock can be used to test modules that perform HTTP requests in isolation. For instance,

Nock 11.9k Jan 3, 2023
🌐 Human-friendly and powerful HTTP request library for Node.js

Sindre's open source work is supported by the community. Special thanks to: Human-friendly and powerful HTTP request library for Node.js Moving from R

Sindre Sorhus 12.5k Jan 9, 2023
Isomorphic WHATWG Fetch API, for Node & Browserify

isomorphic-fetch Fetch for node and Browserify. Built on top of GitHub's WHATWG Fetch polyfill. Warnings This adds fetch as a global so that its API i

Matt Andrews 6.9k Jan 2, 2023
A light-weight module that brings the Fetch API to Node.js

A light-weight module that brings Fetch API to Node.js. Consider supporting us on our Open Collective: Motivation Features Difference from client-side

Node Fetch 8.1k Jan 4, 2023
SPDY server on Node.js

SPDY Server for node.js With this module you can create HTTP2 / SPDY servers in node.js with natural http module interface and fallback to regular htt

SPDY & HTTP2 in JavaScript 2.8k Jan 4, 2023
Full-featured, middleware-oriented, programmatic HTTP and WebSocket proxy for node.js

rocky A multipurpose, full-featured, middleware-oriented and hackable HTTP/S and WebSocket proxy with powerful built-in features such as versatile rou

Tom 370 Nov 24, 2022
Simplifies node HTTP request making.

Requestify - Simplifies node HTTP request making. Requestify is a super easy to use and extendable HTTP client for nodeJS + it supports cache (-:. Ins

Ran Mizrahi 222 Nov 28, 2022
A fully-featured Node.js REST client built for ease-of-use and resilience

flashheart A fully-featured Node.js REST client built for ease-of-use and resilience flashheart is built on http-transport to provide everything you n

BBC 118 Jun 21, 2022
Run HTTP over UDP with Node.js

nodejs-httpp - Run HTTP over UDP based transport and Bring Web in Peer or P2P styles main js modules: udt.js, httpp.js, udts.js and httpps.js, that's

AppNet.Link 142 Aug 2, 2022
一个基于node.js,express,socket.io的websocket非常棒的聊天室,代码简单很适合新手. A very nice websocket chat room based on node.js, express, socket.io. the code is simple, very suitable for novices

来来往下看,虽然教程又臭又长但是一步步地保姆式教学很简单的,毕竟我是真菜鸟嘛,当然什么都往细了说╮(╯_╰)╭ 一、使用方法 该教程内容所有指令都为Linux CentOS 7.x环境下指令,其他平台请您自行查询(⊙x⊙;) 1.下载node.js并下载Sakura_Chat_Room node.j

樱樱怪 10 Jul 21, 2022
node

第一步 安装 node node版本须大于14 安装地址http://nodejs.cn/安装页面上的版本即可 下载对应你的系统的安装包 打开安装包,一直下一步到安装完成即可 填入你的cookie inTimeActive 和 longActive 里面的jdCookie.js填入你的cookie

null 6 Feb 17, 2022
QBasic compiler that runs on node.js

QBasic.js QBasic.js allows you to use qb.js inside node projects. Example CLI $ npx qbasic --source=filePath.bas index.js const { compileFile } = requ

Andromeda 3 Oct 24, 2022
Trying to reduce the search time, the objective of this repository is accumulate as many useful code snippets for Node.Js in the real world as possible

Useful Node.Js codes Trying to reduce the search time, the objective of this repository is accumulate as many useful code snippets for Node.Js in the

Juninho 6 Mar 28, 2022
Very very very powerful, extensible http client for both node.js and browser.

ES-Fetch-API 中文 | English Very very very powerful, extensible http client for both node.js and browser. Why should you use ES-Fetch API? Still using a

null 17 Dec 12, 2022
Async node.js implementation of the UDP Minecraft Server Query Protocol and TCP Minecraft Server List Ping Protocol

?? Mc Server Status Async node.js implementation of the UDP Minecraft Server Query Protocol and TCP Minecraft Server List Ping Protocol. Also availabl

Daniel 5 Nov 10, 2022
catbot-9000 is a javascript market-loser bot running on node.js.

catbot-9000 catbot-9000 is a Chia bot framework running on node.js. It was used during the CATMOS launch event on Hashgreen. If you are looking for th

null 9 Nov 16, 2022