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?

<img alt="what is nodejs" data- data-src="https://kirelos.com/wp-content/uploads/2022/08/echo/what-is-nodejs-e1661833300375.png" data- height="405" src="data:image/svg xml,” width=”800″>

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. 

<img alt="nodejs official website" data- data-src="https://kirelos.com/wp-content/uploads/2022/08/echo/nodejs-official-website-e1661833432340.png" data- height="735" src="data:image/svg xml,” width=”800″>

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

<img alt="click on installer" data- data-src="https://kirelos.com/wp-content/uploads/2022/08/echo/click-on-installer-e1661833462672.png" data- height="509" src="data:image/svg xml,” width=”800″>

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

<img alt="accept the agreement" data- data-src="https://kirelos.com/wp-content/uploads/2022/08/echo/accept-the-agreement-e1661833487790.png" data- height="555" src="data:image/svg xml,” width=”800″>

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

<img alt="choose installation location" data- data-src="https://kirelos.com/wp-content/uploads/2022/08/echo/choose-installation-location-e1661833510443.png" data- height="626" src="data:image/svg xml,” width=”800″>

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.

<img alt="choose nodejs setup" data- data-src="https://kirelos.com/wp-content/uploads/2022/08/echo/choose-nodejs-setup-e1661833541215.png" data- height="620" src="data:image/svg xml,” width=”800″>

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

<img alt="click on next to ready the install" data- data-src="https://kirelos.com/wp-content/uploads/2022/08/echo/click-on-next-to-ready-the-install-e1661833812894.png" data- height="611" src="data:image/svg xml,” width=”800″>

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

<img alt="open windows command prompt to use nodejs" data- data-src="https://kirelos.com/wp-content/uploads/2022/08/echo/open-windows-command-prompt-to-use-nodejs-e1661833894983.png" data- height="485" src="data:image/svg xml,” width=”800″>

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. 

<img alt="go to nodejs website" data-src="https://kirelos.com/wp-content/uploads/2022/08/echo/go-to-nodejs-website-1500×937.png" height="937" src="data:image/svg xml,” width=”1500″>

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

<img alt="download latest mac version of nodejs" data-src="https://kirelos.com/wp-content/uploads/2022/08/echo/download-latest-mac-version-of-nodejs-1500×445.png" height="445" src="data:image/svg xml,” width=”1500″>

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

<img alt="open the file" data- data-src="https://kirelos.com/wp-content/uploads/2022/08/echo/open-the-file-e1661834023654.png" data- height="576" src="data:image/svg xml,” width=”800″>

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. 

<img alt="complete the installation process" data- data-src="https://kirelos.com/wp-content/uploads/2022/08/echo/complete-the-installation-process-e1661834051559.png" data- height="579" src="data:image/svg xml,” width=”800″>

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

<img alt="open command terminal to use nodejs" data- data-src="https://kirelos.com/wp-content/uploads/2022/08/echo/open-command-terminal-to-use-nodejs-e1661834081183.png" data- height="517" src="data:image/svg xml,” width=”800″>

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. 

<img alt="type sudo apt install nodejs" data- data-src="https://kirelos.com/wp-content/uploads/2022/08/echo/type-sudo-apt-install-nodejs-e1661834150295.png" data- height="451" src="data:image/svg xml,” width=”800″>

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. 

<img alt="go to nodejs official website" data- data-src="https://kirelos.com/wp-content/uploads/2022/08/echo/go-to-nodejs-official-website-e1661834266321.png" data- height="444" src="data:image/svg xml,” width=”800″>

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

<img alt="click on install nodejs via package manager" data- data-src="https://kirelos.com/wp-content/uploads/2022/08/echo/click-on-install-nodejs-via-package-manager-e1661834291381.png" data- height="437" src="data:image/svg xml,” width=”800″>

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

<img alt="click on debian and ubuntu-based linux distributions" data- data-src="https://kirelos.com/wp-content/uploads/2022/08/echo/click-on-debian-and-ubuntu-based-linux-distributions-e1661834312117.png" data- height="800" src="data:image/svg xml,” width=”485″>

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

<img alt="click on nodejs binary distributions" data-src="https://kirelos.com/wp-content/uploads/2022/08/echo/click-on-nodejs-binary-distributions-1500×1206.png" height="1206" src="data:image/svg xml,” width=”1500″>

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

<img alt="you will be redirected to github" data-src="https://kirelos.com/wp-content/uploads/2022/08/echo/you-will-be-redirected-to-github-1500×792.png" height="792" src="data:image/svg xml,” width=”1500″>

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.

<img alt="scroll down to the latest version" data-src="https://kirelos.com/wp-content/uploads/2022/08/echo/scroll-down-to-the-latest-version-1500×417.png" height="417" src="data:image/svg xml,” width=”1500″>

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

<img alt="copy first line of code and paste in command terminal" data-src="https://kirelos.com/wp-content/uploads/2022/08/echo/copy-first-line-of-code-and-paste-in-command-terminal-1500×343.png" height="343" src="data:image/svg xml,” width=”1500″>

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

<img alt="curl not found message" data- data-src="https://kirelos.com/wp-content/uploads/2022/08/echo/curl-not-found-message.png" data- height="187" src="data:image/svg xml,” width=”657″>

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. 

<img alt="install curl" data- data-src="https://kirelos.com/wp-content/uploads/2022/08/echo/install-curl-e1661834451517.png" data- height="358" src="data:image/svg xml,” width=”800″>

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. 

<img alt="copy the second line of code from github" data-src="https://kirelos.com/wp-content/uploads/2022/08/echo/copy-the-second-line-of-code-from-github-1500×343.png" height="343" src="data:image/svg xml,” width=”1500″>

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. 

<img alt="type node v in terminal" data- data-src="https://kirelos.com/wp-content/uploads/2022/08/echo/type-node-v-in-terminal-e1661834556430.png" data- height="432" src="data:image/svg xml,” width=”800″>

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

Step 1: Open the macOS command terminal.

<img alt="search and open terminal" data- data-src="https://kirelos.com/wp-content/uploads/2022/08/echo/search-and-open-terminal-e1661834568910.png" data- height="332" src="data:image/svg xml,” width=”800″>

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. 

<img alt="type in node –version" data- data-src="https://kirelos.com/wp-content/uploads/2022/08/echo/type-in-node-version-e1661834616897.png" data- height="372" src="data:image/svg xml,” width=”800″>

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

<img alt="type in npm –version" data- data-src="https://kirelos.com/wp-content/uploads/2022/08/echo/type-in-npm-version-e1661834633225.png" data- height="335" src="data:image/svg xml,” width=”800″>

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.