Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan Now×
Skip to content
VGSources
Blog

How to Compile Node.js and npm From Source on Linux

A release-aware Linux guide to compiling Node.js and its bundled npm from source, with current compiler requirements, distribution prerequisite commands, verification tests, debug builds and shared-library cautions.
Length9 min Posted Quest giverVGSources Team
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To compile Node.js on Linux, check out the release tag you need, install the compiler, GNU Make and Python versions required by that tag’s BUILDING.md, then run ./configure and make -j4. Verify the result with make test-only and a local ./node command. npm is normally built and bundled from the repository’s deps/npm tree, so a separate npm compilation is not part of the standard workflow.

The commands below follow the Node.js project’s current Linux guidance (2026). Treat compiler versions, supported kernels and package names as release-specific: always read the BUILDING.md belonging to the exact tag you intend to build.

As an Amazon Associate I earn from qualifying purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What a source build produces

A source build gives you Node.js binaries compiled for your own Linux environment rather than a prebuilt distribution package. This is useful when you need to test a particular release commit, develop Node.js itself, build with diagnostic instrumentation, or package Node for a controlled system. It also lets you choose whether the result is installed system-wide or kept in the build tree for testing.

Node.js normally bundles its dependencies into the executable. The normal build therefore produces a self-contained Node runtime together with the npm distribution that lives in deps/npm. Building “Node and npm from source” means building the Node.js repository; there is no second, independent npm build step in the default configuration.

#1 Best Overall
Sale
Gaoye Blue Light Blocking Glasses
  • BLUE LIGHT BLOCKING GLASSES: Our blue light glasses for women boast UV400 protection, blocking harmful blue rays from computer screens. With these bluelight glasses women, you can enjoy gaming, reading, or watching TV with no worries of eye strain.
  • EYE RELIEF: Our blue light glasses are engineered to reduce blurry vision or strain caused by prolonged screen time. These womens blue light glasses aid in better sleep by preventing blue light from disrupting your natural sleep cycle, helping you fall asleep faster and enjoy a more restful night's sleep, making them the perfect christmas present.
  • COMFORTABLE: Crafted from durable material, our trendy blue light glasses for woman or blue light glasses men ensure long-lasting comfort. The high-transmittance lenses accessories, gamer gifts for men, help keep your eyes relaxed. Perfect stocking stuffers, gifts for gamers men, christmas gifts for men, halloween costumes.
  • LIGHTWEIGHT: These clear blue light glasses feature a lightweight frame, meaning they’ll stay comfy for long-term wear. Perfect as blue blockers glasses for women or mens blue light glasses, these non-prescription fake glasses for men can be worn throughout the day. The blue light blocking glasses women feature polycarbonate HD lenses, which are anti-reflective and restore true color.
  • WORRY-FREE PURCHASE: If you experience any issues, our support team is ready to assist you quickly. These are the perfect costume glasses for cosplay dressing up.

Match the source checkout to its build instructions

The project’s supported operating systems, compilers and build options change over time. The authoritative instructions are the BUILDING.md file in the release line you are compiling, not a guide written for a different version. The current document is a moving reference, so a production or distribution build should begin by selecting the exact tag and then reading that tag’s file.

Release tag or main branch?

  • Release tag: choose this for reproducible builds, packaging and applications that must track a published Node.js version. Pinning the checkout means the source, bundled npm version and build requirements are known.
  • Main branch: choose this for Node.js development or testing upcoming changes. It can require newer tools and may change without notice.

The prerequisite commands shown later install build tools; they do not choose a Node.js version. Pin the repository to a tag or commit when repeatability matters.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Linux prerequisites

For the current Linux guide, the minimum toolchain examples are:

Component Current requirement or guidance Why it matters
C compiler GCC 13.2 or newer, or Clang 19.1 or newer Compiles Node.js and native dependencies.
C++ compiler G++ 13.2 or newer, or Clang++ 19.1 or newer Builds the C++ portions of Node.js and V8.
GNU Make 3.81 or newer Runs the generated build targets.
Python A version supported by the selected release’s BUILDING.md Drives configuration and build scripts.
pip Needed when you run coverage tooling Installs Python packages used by coverage workflows; it is not the core compiler.
Memory At least 8 GB is typically required for four parallel jobs Prevents memory pressure during make -j4.

For the current GNU/Linux x64 and arm64 Tier 1 examples, the guide uses a kernel of at least 5.14 and glibc of at least 2.34. Other architectures or older userlands may have different support boundaries; consult the matching release documentation rather than assuming these figures apply universally.

Check the tools before configuring

After installing the prerequisites, check that the commands resolve to the versions you expect:

gcc --version
g++ --version
make --version
python3 --version

If the compiler shown is older than the release requirement, install or select the newer toolchain before running ./configure. A successful package-install command alone does not prove that your shell is using the intended compiler.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Install prerequisites by distribution

The current official guide lists these examples. They install build prerequisites only; they do not install Node.js and do not select a source version.

Distribution family Command from the current guide
Ubuntu or Debian
sudo apt-get install python3 g++-13 gcc-13 make python3-pip
Fedora
sudo dnf install python3 gcc-c++ make python3-pip
CentOS or RHEL
sudo yum install python3 gcc-c++ make python3-pip
openSUSE
sudo zypper install python3 gcc-c++ make python3-pip
Arch or Manjaro
sudo pacman -S python gcc make python-pip
Nix or NixOS
nix-shell

Distribution repositories can change package names and compiler defaults. If a command installs an older compiler than your selected Node.js tag requires, use the newer toolchain documented for that release and confirm the active versions before configuring.

Rank #2
Windex Gaming Cleaning Wipes, Pre-Moistened Wipes to Instantly Clean all Gaming Gear and Electronics, Resealable Packaging for a Freshness Lock, 25 count (Pack of 1)
  • WINDEX GAMING WIPES: effortlessly clean all your gaming gear and gaming electronics in one easy step with our new Windex Gaming Wipes
  • AMMONIA FREE: our ammonia-free formula is safe to use on all of your favorite gaming equipment like consoles, headsets, controllers, screens, keyboards, and more
  • PRE-MOISTENED WIPES: each wipe instantly removes dust, dirt, and stubborn smudges and fingerprints leaving a streak-free shine
  • ANTI-STATIC: great for cleaning and wiping down your gaming gear and electronics leaving behind no visible residue
  • COMPACT RESEALABLE PACKAGE: store your pack of Windex Gaming Wipes anywhere in your home for whenever a quick and easy wipedown is needed

Fetch and pin the Node.js source

Clone the official repository, enter it, and—when you need a reproducible build—check out the desired release tag or commit. The repository is available at https://github.com/nodejs/node.git.

git clone https://github.com/nodejs/node.git
cd node
# For a reproducible build, check out the exact release tag or commit here.
# Example form: git checkout vX.Y.Z

Replace the example tag with the release you have selected; do not treat vX.Y.Z as a real version. Once checked out, open that revision’s BUILDING.md and compare its platform and toolchain requirements with your machine.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Keep the build path simple

The official guide warns that a source path containing a space can make the build fail. Place the checkout in a directory whose full path contains no spaces, such as a conventional source or home-directory path. If configuration or compilation fails and the path contains spaces, move the tree and configure again before investigating more complicated causes.

Configure and compile

From the root of the Node.js checkout, the canonical release build is:

./configure
make -j4

./configure detects the host environment and generates the build files. The second command compiles Node.js with four concurrent jobs. Four jobs are only an example: lower the number on a memory-constrained machine, or raise it when you have additional CPU and RAM and the selected release permits that configuration. The current guide’s 8 GB figure is specifically typical for four parallel jobs, not a guarantee for every hardware or build option.

Let the build finish before attempting installation or tests. A compiler error, missing Python module or unsupported toolchain should be fixed at the prerequisite or configuration stage; rerunning make without addressing the reported cause normally produces the same failure.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How npm is included

The Node.js source tree contains npm under deps/npm, including its source, tests and package metadata. npm’s README states that npm comes bundled with node and with most third-party distributions by default. Consequently, the normal Node.js source build supplies the bundled npm distribution; there is no separate physical npm product that you compile with another top-level command.

If you need to audit the npm version or its files, inspect the checked-out deps/npm directory after selecting the Node.js tag. Changing the Node.js tag changes the bundled npm content along with the runtime source.

Rank #3
Sale
LISEN Cell Phone Stand Phone Holder for Desk, Office Decor Gadgets for Men
  • Ergonomic & Adjustable Design: Fight "text neck" and improve your posture. Designed for comfort, it offers an adjustable height (7.1in-8.5in) (1.4in adjustable range) and angle (5°-85°) Please note: cell phone stand is only 9 inches tall—the length of a standard pencil
  • Without blocking subtitles Perfect for office desk Tiktok Face Time Zoom video—this is the ultimate kitchen desk essential for phones! Perfect viewing experience while reducing neck back strain, A must-have for gamers streamers desk, and anyone who values both style and support!
  • Sleek & Stable Design fits Otterbox Case: Say goodbye to bent cables, tangles, and tip-overs! LISEN’s stylish adjustable desk phone holder features a built-in charging hole and smart cable management, keeping your phone secure and your workspace clutter-free cool gadgets for men
  • ANTI-SLIP DESIGN free hands: The under 10.00 items easy gadgets back and the bottom of this kitchen essentials for women are fully covered by anti-skid silicone, which LISEN stand up desk decor can provide maximum protection device from any scratches and slides
  • Your Perfect Viewing Companion:If your product arrives damaged or breaks within 365 days, reach out to LISEN for a quick and hassle-free solution. Struggling with assembly, like tightening the screw? We’ve got your back! Your experience matters to us. (Product including: phone Holder stand*1, screw*1, hexagon screwdriver*1, specification*1)

Verify the build before installing it

Run the focused verification target

The project’s documented build verification command is:

make test-only

This target is the first check to run after compilation. It exercises the built runtime without requiring you to install it into the system. A failure here means the binary is not ready to rely on, even if compilation itself completed.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Run the full test target

For a broader check, run:

make -j4 test

This runs the full codebase test check, including documentation tests. It can take substantially longer and consume more resources than make test-only. Keep the parallelism appropriate for the available memory, just as you did for compilation.

Run selected tests while developing

When iterating on a particular area, the guide documents the test runner form:

tools/test.py <pattern>

Use a pattern that identifies the tests you want to exercise. A test file can also be executed directly with:

./node <file>

These commands are useful for narrowing a failure before repeating the complete suite.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Perform a direct smoke test

Finally, execute the freshly built binary from the repository:

./node -e "console.log('Hello from Node.js ' + process.version)"

Running ./node instead of a system node is important: it proves that the binary you just compiled starts and reports its own version, rather than accidentally invoking an older installation elsewhere on PATH.

Rank #4
Ledagic IC+RGBW USB Powered Led Light Bar with App & Remote Control, 2 Pack
  • Easy Installation: Our gaming lights have been designed to enhance your entertainment experience. Simply position the led light bar next to your TV or game console to create a game room environment with ease. They come with USB power and a 60 inch cord for direct mounting and mobility
  • Audio Syncing & Extensive Mode: The built-in high-sensitivity music sensor allows you to sync the TV led lights to your favorite music. Lights react and move to the beat of music, film and game audio, creating an incredible immersive sound and light experience – and all without the need for an additional hub. You can choose from 64+ patterns, including strobe, illusion, jump, energy, gradient, running, chasing, fluttering mode etc. Each mode can be applied to different scenes
  • 64+ Chasing IC+RGB & W Effect: The independent control design of IC+RGB and white all-in-one multifunctional rgbw led bar lights monitor backlight allows you to easily switch the led lights for desk between IC+RGB and white to enjoy a variety of lighting effects, you can choose white lighting mode with high brightness for better illumination when working, etc. Choose IC+RGB lighting mode when you need to create an entertaining atmosphere for the light show, 16 million colours of Color changing rgb light bar let you dance to the beat and create a dynamic party atmosphere
  • Dynamic and Dimmable Lights: 1%-full brightness free brightness adjustment gives you the flexibility to adjust dimmable led light bar for room decorations or a variety of occasions
  • USB Powered: USB light bars for room can be powered by powernank, usb charger, TV, Monitor, laptop PC mainframe, making behind TV led lighting bar easy to install in any location.TV led lights are powered by the TV usb interface / PC mainframe, can be turned on/off synchronously with TV / PC

Debug and AddressSanitizer builds

Release plus debug binaries

For runtime debugging, configure with the debug option and compile:

./configure --debug
make -j4

The documented result includes release and debug binaries; the debug executable is out/Debug/node. Use that path when you need debug assertions or symbols instead of the default release binary.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

AddressSanitizer

To build the Linux AddressSanitizer configuration, use:

./configure --debug --enable-asan
make -j4
make test-only

Run the focused tests after the instrumented build. Sanitizer builds are intended for finding memory errors and can have different performance and resource characteristics from a normal release build, so do not substitute them for the release artifact you plan to distribute.

Installation choices

You can use the compiled runtime directly from the checkout, which is safest while developing or testing. If the verification steps pass and you need a system installation, the documented optional command is:

sudo make install

A system install writes into the prefix selected by the release’s configuration and may require administrator privileges. A user-local prefix is often preferable on development machines because it avoids changing the system runtime, but the exact prefix option and supported layout are release-specific; use the matching BUILDING.md rather than copying an option from another Node.js version.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

After installation, open a new shell or refresh command lookup as appropriate for your environment, then check that node resolves to the intended installation. Keep the direct ./node smoke test as a way to distinguish the build-tree binary from any system copy.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Bundled versus shared dependencies

Node.js normally places its dependencies in the binary. Distributors can request shared native libraries or shared JavaScript builtins through configure options, but that is a distribution decision rather than a routine optimization.

Best Value
Sale
HUANUO FlowLift™ Dual Monitor Stand, Fully Adjustable Gaming Monitor Desk Mount for 13–32″ Computer Screens, Full Motion VESA 75x75/100x100 with C-Clamp & Grommet Base, Each Arm Holds 4.4 to 19.8 lbs
  • Compatible with Wide Screens - To ensure compatibility with the dual monitor mount, your each monitor must meet three conditions at the same time: First, computer screens size range: 13 to 32 inches. Second, screen weight range: 4.4 to 19.8 lbs. Third, the back of the monitor screen must have VESA mounting holes with a pitch of 75x75mm or 100x100mm.
  • Regarding the compatibility with desks - Your desk must meet three conditions at the same time: First, desk material: Only wooden desks are recommended, plastic or glass desks cannot be used. Second, desk thickness range: 0.59" - 3.54". Third, the bottom of the desk should not have any cross beams or panels, as this will interfere with installation. We recommend carefully checking that your desk and monitors meets all above conditions before purchasing.
  • Dual C-Clamp Hold - Worried your dual monitors might wobble or slip? Our upgraded base uses a larger platform plus a dual C-clamp structure to lock the dual monitor arm firmly to your desk. Each arm safely keeps your screens steady while you type, click and game—no shaking, no sliding, just a clean and secure setup you can trust every day. It also provides Grommet Mounting installation choice, both options ensure stable and secure fixation for your 0.59" - 3.54" desk.
  • Full-Motion Adjustment For Comfortable View - Pull the screen closer when you’re deep in a spreadsheet, push it back to watch videos, or rotate to portrait for coding — moving everything smoothly with just one hand. The monitor stand offers +85°/-50° tilt, ±90° swivel and 360° rotation. Raise your monitor up to 15.75″ to support a healthy sitting posture. Whether you’re working from home, gaming through the night, or switching between video calls and documents, getting the screens to your natural line of sight helps relieve neck, shoulder and back strain so you can stay focused longer with less fatigue.
  • Keep Your Desk Organized: By lifting both screens off the desktop, this dual monitor stand opens up valuable space for your keyboard, notebook, docking station or a simple, clutter-free work area. Built-in cable management guides wires along the arms, keeping cords out of sight and out of the way. Enjoy a tidy, modern workstation that looks as good as it feels to use.

A shared-library build carries two obligations:

  • The runtime libraries available on the target system must remain compatible with the versions the binary expects.
  • The complete test suite must be run for the exact combination, because upstream continuous-integration coverage may be limited for non-default shared configurations.

For a personal custom runtime, the default bundled build is the lower-risk choice. Consider shared components only when your distribution policy requires them and you can control the runtime library versions and testing process.

Build-performance options for repeated work

If you rebuild frequently, the guide documents using ccache and an optional mold linker setup. These can reduce repeated compile or link time, but they do not change the need to use a supported compiler, keep the source path free of spaces and run the verification targets. Introduce them after a clean, working baseline so that a cache or alternate linker does not obscure the cause of a failure.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Troubleshooting by symptom

Configuration rejects the compiler

Read the error and compare the active GCC, G++ or Clang versions with the requirements in the checked-out tag’s BUILDING.md. On distributions that provide multiple toolchains, install the documented version and ensure your shell selects it before rerunning ./configure.

The build fails in a directory with spaces

Move the checkout to a path without spaces, remove the failed generated state if the release instructions require it, and run ./configure again from the new location. The path warning is specific to the build system and can appear unrelated to the compiler error shown at the end.

The machine runs out of memory

Reduce parallelism from -j4 to fewer jobs and retry. Four jobs typically need at least 8 GB of RAM according to the current guide; large debug or sanitizer builds can impose additional pressure. Increasing swap may keep a build alive, but it will usually make compilation slower.

Tests invoke the wrong Node binary

Run the smoke test as ./node from the source directory and inspect which executable your shell resolves after installation. Do not use an unqualified node command to validate an uninstalled build, because that can select a different runtime on PATH.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A shared build works on one host but not another

Check the target host’s runtime library versions against the versions expected by the binary, then repeat the full test suite on that host. Shared configurations have less upstream CI coverage than the default bundled arrangement, so a successful link on the build machine is not sufficient evidence of portability.

Choose the workflow that fits your goal

Goal Source choice Configuration Verification emphasis
Reproducible custom runtime Exact release tag or commit Default bundled dependencies make test-only, then the full suite as required
Node.js development Main branch or development commit Default build, with targeted rebuilds tools/test.py <pattern> and focused tests
Runtime debugging Matching development or release revision ./configure --debug Use out/Debug/node and run tests
Memory-error investigation Revision that reproduces the issue --debug --enable-asan Build, then make test-only
Distribution packaging Pinned release source Evaluate bundled or shared dependencies deliberately Full tests on the target runtime and library set

The safest general path is therefore: pin a release, satisfy that release’s documented toolchain, configure with defaults, compile with parallelism your memory can support, verify before installation, and keep npm as the bundled deps/npm content that ships with the resulting Node.js build.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More quests from Patch Notes

  1. How to Set Up a RedM (RDR2) Server in 2026: License Key, txAdmin and server.cfg, Step by StepBlog11min
  2. Best RedM (RDR2) Server Hosting in 2026: Comparing Four Hosts on Slots, Memory and PriceBlog10min
  3. How to Host a Mindustry Server in 2026: server-release.jar, Port 6567 and the Commands That MatterBlog7min
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.