nodenv /node-build
A tool to download, compile, and install Node on Unix-like systems.
★ 300⑂ 89👁 5⑃ 1,023● 123▤ 351◈ 0
300
stars
89
forks
5
watchers
1,023
prs
123
issues
351
releases
0
discussions
README
node-build
Download, compile, and install Node on Unix-like systems.
node-build is a command-line tool that simplifies installation of any Node version from source or precompiled binary on Unix-like systems.
It is available as a plugin for [nodenv][] as the nodenv install command, or as a standalone program as the node-build command.
- Installation
Upgrading
+ Updating available build versions
- Usage
Basic Usage
Advanced Usage
+ Binaries
+ Custom Build Definitions
+ Custom Build Configuration
+ Applying Patches
+ Checksum Verification
+ Package Mirrors
+ Keeping the build directory after installation
+ Retry installation without v/node-/node-v prefix
- Getting Help
- Credits
Installation
Homebrew package manager
sh
brew install node-build
Upgrade with:
sh
brew upgrade node-build
Clone as nodenv plugin using git
sh
git clone https://github.com/nodenv/node-build.git "$(nodenv root)"/plugins/node-build
Upgrade with:
sh
git -C "$(nodenv root)"/plugins/node-build pull
Install manually as a standalone program
First, download a tarball from https://github.com/nodenv/node-build/releases/latest. Then:
sh
tar -xzf node-build-.tar.gz
PREFIX=/usr/local ./node-build-/install.sh
Usage
Basic Usage
sh
As a nodenv plugin
$ nodenv install --list lists all available versions of Node
$ nodenv install 10.13.0 installs Node 10.13.0 to ~/.nodenv/versions
As a standalone program
$ node-build --definitions lists all available versions of Node
$ node-build 10.13.0 ~/local/node-10.13.0 installs Node 10.13.0 to ~/local/node-10.13.0
Warning
node-build mostly does not verify that system dependencies are present before downloading and attempting to compile Node from source. Please ensure that [all requisite libraries][build-env] such as build tools and development headers are already present on your system.
Firstly, if a precompiled binary exists for your platform, node-build downloads and installs it.
Otherwise it will build node from source.
Basically, what node-build does when installing a Node version is this:
- Downloads an official tarball of Node source code;
- Extracts the archive into a temporary directory on your system;
- Executes ./configure --prefix=/path/to/destination in the source code;
- Runs make install to compile Node;
- Verifies that the installed Node is functional.
Advanced Usage
Binaries
By default, node-build will attempt to match one of the precompiled binaries
to your platform. If there is a binary for your platform, it will install it
instead of compiling from source. To force compilation, pass the -c or
--compile flag.
Custom Build Definitions
To install a version of Node that is not recognized by node-build, you can specify the path to a custom build definition file in place of a Node version number.
Check out [default build definitions][definitions] as examples on how to write definition files.Top issues
#145'latest' build definitions6 comments · 2016-04-06#738Add auto-merge for `nodenv-bot` PRs4 comments · 2022-03-17#888Suggestion/Feature: LTS Version marker on the install list3 comments · 2022-02-17#764`nodenv install` tries to use python and fails on MacOS Monterey 12.3 and later and fails3 comments · 2022-06-06#1021`install` should fire hooks allowing plugins to set version for auto-installation2 comments · 2021-10-29#722Support for musl libc 2 comments · 2021-12-27#684Feature Request: Allow only specifying a major version2 comments · 2021-04-23#952Add support for Bun?1 comments · 2024-10-17
Latest release
v5.4.62 v5.4.62 2026-10-29What's Changed Bump step-security/harden-runner from 2.21.1 to 2.22.1 by @dependabot[bot] in https://github.com/nodenv/node-build/pull/1144 Scraped latest definitions by @nodenv-bot in https://github.com/nodenv/node-build/pull/1145 Full Changelog: https://github.com/nodenv/node-build/compare/v5.4.61...v5.4.62