With the demand for full-stack development, Javascript is a reliable technology for creating a full-fledged business application. 

Many JavaScript developers worldwide struggle with swapping different frameworks and languages to amplify their code. That’s where Node.js comes into play. 

With Node.js, you can quickly build web applications with two-way connections where the client and server sides can communicate and exchange data in real-time. 

If you’re looking to install Node and NPM on Windows and macOS systems, we’re here to help. In this article, we’ll provide a step-by-step guide on installing the software. 

But first, let’s get to know the basics!

What is Node.js?

what is nodejs

Node.js, also called Node, is an open-source, cross-platform runtime environment for executing JavaScript code outside a browser. Often, we use Node.js to build back-end services, also called Application Programming Interfaces (APIs). 

These services power our client applications, like a web app running inside a browser or a mobile app running on a mobile device. 

Apps are what the user sees and interacts with. However, these apps require communication to back-end services in the cloud or on the server to store data, send emails, kick off workflows, etc. 

Node.js is perfect for building highly scalable data-intensive and real-time back-end services that power our client applications. 

While there are other tools and frameworks for building back-end services, such as Ruby on Rails, Django, Flask, and Firebase, Node.js is unique from them. 

Node.js is easy to start and can be used for prototyping and agile development. Additionally, it can build incredibly fast and highly scalable services. It’s even used by enterprise organizations such as PayPal, Uber, Netflix, Walmart, etc., because of its speed and scalability.

PayPal rebuilt one of their Java and spring-based applications using Node.js, and they found that: 

  • Their applications were built twice as fast with fewer people 
  • They used 33% fewer lines of code and 40% fewer files 
  • Also doubled the number of requests served per second while decreasing the average response time by 35%

Node applications use Javascript everywhere, including Windows, macOS, and Linux. If you’re a front-end developer with JavaScript skills, you can easily transition to a full-stack developer, allowing you to land better jobs without learning a new programming language. 

Since you can use Javascript on the front-end and back-end, your source code will be cleaner and more consistent. As a result, you’ll use the same naming conventions, the same best practices, and the same tools. 

Furthermore, Node has the largest ecosystem of open-source libraries available to you. This means you can find any features or building blocks to add to your application. Thus, you won’t have to create these building blocks from scratch and instead focus on the core of your application. 

Now that you know the basics of Node.js let’s look at the process you need to do when installing Node for Windows or macOS.

Installing Node.js for Windows

Here are the steps to downloading Node.js for Windows: 

Step 1: Go to the Node.js website and find their downloads page. 

nodejs official website

Step 2: Click on the windows installer to download and open the file. 

click on installer

Step 3: Accept their license agreement by clicking ‘Next.’ 

accept the agreement

Step 4: Choose where you’d like to install Node.js, then click ‘Next.’ 

choose installation location

Step 5: If you’re a beginner, stick with the default Node.js setup by clicking ‘Next.’ You can change the setting as per your needs if you know what impact it’d have on the application.

choose nodejs setup

Step 6: Click next again on the Tool for Native Modules page, then click ‘Install.’ 

click on next to ready the install

Step 7: You’ve now completed the installation. Now, open your command console and begin using Node.js. 

open windows command prompt to use nodejs

Installing Node.js for MacOS

Downloading Node.js for macOS is relatively simple. Follow these installation steps: 

Step 1: Go to the Node.js website. Click on the version of your choice. 

go to nodejs website

Step 2: Download the file and open it in Finder. 

download latest mac version of nodejs

Step 3: Set the location of installation and click on ‘Continue.’

open the file

Step 4: Complete the entire installation steps by clicking continue and agree to their terms until you reach the Summary section and get an installation confirmation. 

complete the installation process

Step 5: Congratulations, you’ve installed Node.js for macOS. Now open your terminal and begin experimenting with commands. 

open command terminal to use nodejs

Installing Node.js for Linux

Follow the steps below to install Node.js for Linux. 

Step 1: Start by opening your terminal or pressing Ctrl + Alt + T. 

Step 2: Type:

sudo apt install nodejs

And then press enter. 

type sudo apt install nodejs

However, you won’t be installing the latest node.js version when performing this command. 

Step 3: Go to the Node.js.org website and click on Downloads. 

go to nodejs official website

Step 4: Scroll down and click ‘Install Node.js via package manager.’

click on install nodejs via package manager

Step 5: Click on ‘Debian and Ubuntu-based Linux distributions.’

click on debian and ubuntu-based linux distributions

Step 6: Once redirected, click on the ‘Node.js binary distributions’ link. 

click on nodejs binary distributions

Step 7: A window will open, and you’ll be directed to the GitHub repository. 

you will be redirected to github

Step 8: Scroll down and find the installation instructions for the latest Node.js version. In this case, we’ll be installing Node.js v18.x.

scroll down to the latest version

Step 9: Copy and paste the first line from the instructions into your terminal and press enter. 

copy first line of code and paste in command terminal

Step 10: You will see a message that the command ‘curl’ is not found. 

curl not found message

Step 11: Type in sudo apt install curl to install curl. Then you’ll be prompted to type in your Ubuntu password and press enter. 

install curl

Step 12: Now you’ve installed curl on your operation system and can download the latest version of Node.js. 

Copy and paste the second line from the Github installation instruction into your terminal and press enter. 

copy the second line of code from github

And you’re done!

How to Check the NPM Version and Verify Download 

NPM is the package manager for Node, meaning that it manages the dependencies for its packages. 

Without an NPM, it would require unpacking the Node.js packages manually when you’re looking to upload a framework. Fortunately, the NPM automates this process and alleviates the responsibility from you. 

Routinely updating the NPM improves the code and updates your local packages utilized in your projects. 

However, sometimes it misses the latest NPM release. Therefore, you’ll want to check your NPM version and manually update it. 

While the process for checking and updating the NPM version is similar, there are a few differences between Windows and macOS. 

Here’s how to check the Node.js version and verify the download for Windows: 

Type the command: node -v, then hit enter, and you’ll see the version number. 

type node v in terminal

If you have a macOS, follow these steps to verify your Node.js and NPM download. 

Step 1: Open the macOS command terminal.

search and open terminal

Step 2: Type node –version (it’s a double dash before version) and press enter. You’ll instantly see if you’ve installed the latest version. 

type in node --version

To check the NPM version, type in npm –version and press enter. 

type in npm --version

Double-check that your installed version is the same as the latest version listed on the Node.js website. 

Once you’ve checked that your Node.js and NPM are installed correctly on your Windows or macOS, you’re ready to begin creating new applications. 

Wrapping Up

Node.js is a highly popular programming environment, especially due to its practicality in the front-end and back-end. Many developers choose Node.js for its simplicity and capabilities for developing advanced applications. Furthermore, it can help you become a full-stack developer in no time. 

After completing the above steps to install NPM and Node, you’re ready to build back-end services. Installing them is the first step in beginning your app development journey. 

You may also be interested in these Node.js bundlers and build tools as a developer.