node-gyp
node-gyp is the cross-platform command-line tool that compiles native add-on modules for Node.js, wrapping a vendored copy of Google's gyp build-configuration generator to drive the local C/C++ toolchain. It is invoked automatically by npm whenever a package contains native code that must be built from source.
MITPermissive — free to use in commercial and proprietary software, with attribution.View license →
Production readiness
5/5- Actively maintainedCommits in the last 6 months
- No known vulnerabilitiesNo OSV advisories
- Clear, usable licenseMIT (permissive)
- Proven adoptionWidely used
- Has documentationDocumentation indexed
pip install node-gypOur analysis
A build orchestration tool that generates and runs platform-native build files (via the gyp generator) to compile Node.js native C/C++ add-ons against the correct Node headers and ABI.
When to use node-gyp
When a Node.js package ships native C/C++ source that must be compiled at install time, or when authoring a native add-on and you want the de facto standard toolchain that npm already integrates with.
When not to
If you prefer a CMake-based workflow (use cmake-js), want to ship prebuilt binaries to avoid end-user compilation (prebuild/prebuildify/node-pre-gyp), or are writing add-ons in Rust (napi-rs/neon).
Strengths
- The default, deeply integrated build path that npm invokes automatically for native modules
- Cross-platform support across Windows, macOS, and Linux toolchains
- Maintained under the official Node.js organization with broad ecosystem reliance
Trade-offs
- Requires a working local C/C++ toolchain plus a specific Python version, a frequent source of cryptic install failures
- The underlying gyp configuration format is dated and poorly documented for newcomers
- End users must compile from source unless the package author adds a prebuilt-binary layer on top
Maturity
Highly mature and production-critical infrastructure; it underpins native module installation across the entire npm ecosystem and is actively maintained by the Node.js project, though it carries legacy gyp baggage and ongoing Python/toolchain compatibility churn.
Versions of node-gyp that are earlier than v11.x.x
Please look thru your error log for the string gyp info using node-gyp@ and if that version number is less than the current release of node-gyp then please upgrade using these instructions and then try your command again.
node-sass is deprecated
Please be aware that the package node-sass is deprecated so you should actively seek alternatives. You can try:
npm uninstall node-sass
npm install sass --save
# or ...
npm install --global node-sass@latest
node-sass projects may work by downgrading to Node.js v14 but that release is end-of-life.
In any case, please avoid opening new node-sass issues on this repo because we cannot help much.
ffi-napi is no longer maintained
node-ffi-napi/node-ffi-napi#269
There are a couple of workarounds (https://koffi.dev or node-ffi-rs) on that issue but using ffi-napi or its forks has proven problematic on modern versions of operating systems, Node.js, node-gyp, and Python.
In any case, please avoid opening new ffi-napi issues on this repo because we cannot help much.