Node-ninja is a cross-platform command-line utility for compiling Node.js native addon modules. It serves as a fork of node-gyp, bundling the gyp project used by the Chromium team, with the long-term, unfulfilled goal of transitioning to the Ninja build system. The tool aims to simplify the process of building native modules across different platforms and supports compiling for multiple Node.js ABI versions by downloading necessary development headers. The current stable version is 1.0.2. Its release cadence is effectively non-existent, as the last release is considerably old, targeting historical Node.js versions (e.g., 0.8, 0.9, 0.10, 1.0) and Python 2.7. Key differentiators from upstream node-gyp, at the time of its last development, included better support for projects with multiple gyp files and incremental builds for prebuilds. However, it is now largely superseded by the actively maintained `node-gyp` and appears to be an abandoned project.
npm install node-ninjaVerified import paths — ran on the pinned version, not inferred.
Demonstrates the typical command-line installation and usage flow for `node-ninja` to configure and build a native Node.js addon.
Ensure Python 2.7 is installed and accessible in your system's PATH. On Windows, verify the `PYTHON` environment variable points to `python.exe` for Python 2.7. You may need to manage Python versions carefully using tools like `pyenv` or `conda`.
Consider migrating your native addons to use `node-gyp`, which is the officially maintained build tool for Node.js native addons and receives regular updates. Be aware that this project is effectively abandoned.
For new projects or existing projects requiring modern Node.js support, it is strongly recommended to use `node-gyp` instead. For legacy projects, proceed with caution, anticipating potential build environment issues.
Carefully follow the installation instructions in the README for your specific Windows version, ensuring you install the correct Visual Studio edition (e.g., 2015 Community) and select the C++ development workloads during installation. Set `GYP_MSVS_VERSION` environment variable if necessary.
Install Python 2.7 and ensure it's accessible in your system's PATH. On Windows, set the `PYTHON` environment variable to the full path of your `python.exe` for Python 2.7.
Install the required version of Microsoft Visual Studio (e.g., 2013, 2015 Community Edition) with the C++ development components. Ensure you open the command prompt via 'Developer Command Prompt for VS' or that relevant environment variables like `GYP_MSVS_VERSION` are set.
On Linux, install `build-essential` (e.g., `sudo apt-get install build-essential`). On macOS, install Xcode from the App Store and then install its Command Line Tools via `xcode-select --install`.
No dependency data recorded yet.