node-gyp is the standard build tool for native Node.js addons and is used by the vast majority of packages in the npm ecosystem. It is actively maintained by the Node.js team. Most of the examples on this site use node-gyp to build binaries.
node-gyp is based on Google's GYP build tool. GYP provides a single cross-platform configuration format for C/C++ builds. Although Google archived the upstream GYP repository, node-gyp continues to receive active development and maintenance independently.
node-gyp requires Python 3.6 or later. Python 2 is not supported. The full list of requirements for each platform can be found in the node-gyp installation docs.
node-gyp is included with npm; when npm sees "gypfile": true in package.json, it invokes node-gyp automatically during npm install. You can also install and use it directly:
npm install -g node-gypFor developers who find node-gyp too constraining, CMake.js is a good alternative.
- Included with npm - no separate global install required for consumers.
- Nearly universally used in the Node.js ecosystem, with broad documentation and community knowledge.
- Supports Windows, macOS, and Linux from a single
binding.gypconfiguration file.
- The underlying GYP format is no longer actively developed by Google.
- Some developers find GYP's configuration syntax verbose or difficult to debug.