Registry / http-networking / node-curl

node-curl

JSON →
library0.3.3jsnpmunverified

node-curl is an abandoned Node.js package that provides a wrapper around the `libcurl` library, allowing developers to perform HTTP and other network requests with access to all standard cURL options and information retrieval. Released with version 0.3.3, its last update was in 2014, making it incompatible with modern Node.js versions (the `engines` field specifies `>= 0.6.0`). Due to its age and lack of maintenance, it does not support current Node.js APIs, `node-gyp` versions, or ESM. It distinguishes itself by offering both a high-level function-based API and a lower-level `Curl` class for granular control over the transfer process. For contemporary applications, the actively maintained `node-libcurl` library serves as a modern and compatible alternative, which was originally based on the work of `node-curl` but has been largely rewritten.

npm install node-curl
INSTALL
IMPORT
SIG · NODE-CURL
N
node-curl
http-networkingjavascriptv0.3.3
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

curl
const curl = require('node-curl');
import curl from 'node-curl';
This package is CommonJS-only and does not support ESM `import` syntax.
Curl
const Curl = require('node-curl/lib/Curl');
import { Curl } from 'node-curl/lib/Curl';
Accesses the lower-level Curl class directly. CommonJS-only.

Demonstrates a basic GET request and another with options (verbose output, raw buffer body).

const curl = require('node-curl'); curl('https://www.google.com', function(err) { if (err) { console.error('cURL error:', err); return; } console.info('HTTP Status:', this.status); console.info('-----'); console.info('Response Body Length:', this.body ? this.body.length : 0); console.info('-----'); console.info('Download Size (bytes):', this.info('SIZE_DOWNLOAD')); }); curl('https://httpbin.org/get', { VERBOSE: 1, RAW: 1 }, function(err) { if (err) { console.error('cURL with options error:', err); return; } console.info('-----'); console.info('Full cURL Result (RAW:1):', this); });
Debug
Known issues
breakingThis package is highly incompatible with modern Node.js versions due to significant changes in Node.js's native addon API (N-API) and `node-gyp` since its last update in 2014. Installation will likely fail on Node.js versions newer than 0.x or early 4.x.
fix
Use a maintained alternative like `node-libcurl` (`npm install node-libcurl`) or a pure JavaScript HTTP client like `axios` or `node-fetch`.
affects: >=0.4
breakingNative module compilation often fails on modern operating systems because it requires specific C/C++ compiler toolchains and `libcurl` headers that are difficult to align with current Node.js and system configurations. Errors like 'fatal error: curl/curl.h: No such file or directory' are common.
fix
Ensure `libcurl-dev` (or equivalent) and a compatible C++ compiler are installed on your system, and attempt to use an older Node.js version. However, switching to `node-libcurl` is strongly recommended as it provides prebuilt binaries for many environments.
affects: >=0.4
gotchaThe package is exclusively CommonJS (`require()`) and does not support ES Modules (`import`) syntax, which is standard in modern JavaScript environments. Attempting to `import` it will result in `ERR_REQUIRE_ESM` or similar errors.
fix
Refactor your codebase to use CommonJS `require()` or, preferably, migrate to a modern, actively maintained library that supports ES Modules.
affects: >=0.3.3
deprecatedThe `node-curl` package is effectively deprecated and abandoned. There have been no updates since 2014, leaving it with potential unpatched security vulnerabilities and no support for new `libcurl` features or Node.js advancements.
fix
Migrate immediately to an actively maintained alternative like `node-libcurl` which provides similar functionality with modern Node.js compatibility and ongoing security updates.
affects: >=0.3.3
Errors
Common errors & fixes
Error: `make` failed with exit code: 2
Native addon compilation failed, often due to incompatible Node.js versions, missing `libcurl` development headers, or an outdated `node-gyp` setup.
fix
For `node-curl`, there's no reliable fix for modern Node.js. For `node-libcurl` (the alternative), ensure you have Python 3.x and a C++17 compatible compiler, or rely on prebuilt binaries.
fatal error: curl/curl.h: No such file or directory
The `libcurl` development headers are not found in the system's include paths during native module compilation.
fix
Install `libcurl` development packages (e.g., `libcurl4-openssl-dev` on Debian/Ubuntu, `curl-devel` on RHEL/CentOS, `brew install curl` on macOS). However, this may not resolve underlying `node-gyp` compatibility issues with `node-curl` itself.
ERR_REQUIRE_ESM is not defined
Attempting to use `require()` within an ES Module (e.g., in a file with `"type": "module"` in `package.json` or a `.mjs` file) or attempting to `import` a CommonJS-only package.
fix
Refactor your module to use CommonJS if the environment strictly requires it, or, ideally, migrate to `node-libcurl` which offers modern usage patterns and potentially better ESM support.
Cannot find module 'node-curl'
The package either failed to install due to compilation issues, or it was never installed.
fix
First, attempt `npm install node-curl`. If it fails with compilation errors, refer to other `warnings` and `problems` entries related to native module compilation. The most robust fix is to switch to `node-libcurl`.
Upgrade
Version history
0.3.3latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources