Install Node.js: A Tutorial

Node.js is an JavaScript runtime that works on multiple operating systems and is useful for both front- and back-end applications. This tutorial explains how to install it on your machine.

Written by David Koff
JavaScript code on a terminal screen
Image: Shutterstock / Built In
UPDATED BY
Abel Rodriguez | Jun 16, 2025
Summary: Node.js is an open-source JavaScript runtime used across operating systems for front- and back-end development. It can be installed via a basic installer or source code. The platform supports scalable, cross-platform apps and includes tools like npm for package management.

Node.js is a powerful, open-source runtime environment that allows developers to build network applications, including web servers. This JavaScript-based program enables JavaScript to run outside the browser, allowing it to power backend logic, APIs and command-line tools. Node.js is unique for its use on both the front and back end alike, providing more versatility for web developers.

Video: YouTube

More in Software EngineeringWhat Is AJAX (Asynchronous JavaScript and XML)?

 

How to Install Node.js Through the Basic Installer

Node.js can be installed in several ways — the easiest for most users being through the basic installer provided on the official Node.js website

 

How to Install Node.js on Mac and Windows

Installing Node.js is similar for both operating systems. Below are the steps to follow. 

1. Download the Installer: Navigate to the download page and select the .pkg installer for macOS or the .msi version for windows. 

Node.js offical website and download page.
Image: Screenshot

 

2. Run the Installer: After completing the download, launch the installer and follow the directions on-screen.

A screenshot of the node.js installation process
Image: Screenshot.

 

3. Customize the Installation: During the installation you can select the installation path and choose other optional features like installing tools for native modules.  

A screenshot of node.js customization process for node.js
Image: Screenshot

 

4. Verify the Installation: After the installation is complete verify that it is running. To do so open the Terminal on Mac or Command Prompt on windows and enter: Node-v

Binaries and Docker Images are also available for those who might need them. Developers should install the long-term support (or LTS) version as it’s the most stable. Newer installations of Node.js are available, however, called “nightly builds.” These offer more features but have not been time-tested publicly like the LTS versions. Users should think of these nightly builds as beta releases and proceed accordingly.

 

How to Install Node.js With Source Code

Node.js is open-source software, which means that anyone — , programmers or laypeople — can view the code, suggest improvements, or even fork the software to create a slightly or radically different version. Installing Node.js via source code is also possible, but because this route requires compiling code it’s only recommended for those with more programming experience who already have the compiling software required.

Those wishing to work with the Node.js source code must first find or create a suitable build.

1. Prepare a C++ compiler

Much of Node.js is written in C/C++, and many of its modules are implemented in these languages. The compiler is necessary for translating computer code into an easy-to-review language. 

2. Install Python

Although Python is not necessary for other Node.js installation options, it is critical for the source code-based option. Node.js has been built with GYP, a cross-platform built program written in the Python language. Since multiple Python scripts appear here, Python is necessary for source code operations.

3. Download the source code from the Node.js website.

The source code appears in a .tar.gz file. The website provides access to all editions of Node.js, giving users the option to download whatever source codes they prefer. 

4. Launch the /CONFIGURE command and then launch MAKE 

5. Test the compiled program with make test 

6. Enter make install to install the source code program. 

7. Enter node –version to check what version of Node.js is running.

The process lets you know the specific version of Node.js that works here

Installing Node.js through the source code is only recommended for people with more technical experience. Since the source code is more complex, users might require additional support in reading the content. This option is also slower than any other item.

More From David KoffHow to Pass an Array From Java to JavaScript

 

Advantages of Node.js

Node.js offers a host of powerful and unique features.

1. Cross-Platform Compatibility

Node.js runs across multiple platforms, making it a good choice for developing both desktop and mobile applications. 

2. Full-Stack Development Support

Node.js enables developers to use JavaScript for front-end and back-end development, streamlining workflows and simplifying maintenance as a single language handles both UI and server-side logic. 

3. Scalable Single-Thread Architecture

Node.js uses a single-threaded, event-driven model architecture. This minimizes execution times and enables applications to efficiently scale by allowing multiple users to share system resources. 

4. Asynchronous Processing

Node.js supports blocking and non-blocking operations. Non-blocking calls allow multiple processes to run simultaneously thus improving performance and responsiveness. 

5. Strong Community and Documentation Support

Node.js offers abundant support. The official Node.js website provides thorough tutorials and community members provide ongoing support through forums and online groups.

Frequently Asked Questions

Node.js is primarily used for building server-side applications and APIs using JavaScript. 

npm  stands for Node Package Manager. It is used to install, manage and share code packages known as modules or dependencies. Node.js can run without npm but it is recommended to install npm. 

To verify Node.js installed correctly, open a Terminal or Command Line window (depending on your operating system) and use the Node version shorthand node -v. This will check which version of Node.js is installed on your machine. If none is installed, it will return an error message.

Explore Job Matches.