Document
How to Install Node.js and npm on Windows, macOS & Linux

How to Install Node.js and npm on Windows, macOS & Linux

Node.js came as a blessing for JavaScript developers worldwide struggling with swapping among multiple languages and frameworks to amplify their code

Related articles

How to Install a VPN on Meta Quest: Easy Setup & Use (2024) How to Watch Hulu outside US with a VPN in 2024 What is VPN and How It Works? Best Free Internet VPN Services with Unlimited Data in 2024 Best Black Friday & Cyber Monday VPN Deals in 2024

Node.js came as a blessing for JavaScript developers worldwide struggling with swapping among multiple languages and frameworks to amplify their code into a sustainable development environment.

So if you’re looking to take your web development skills to the next level, Node.js can certainly help you reach that goal.

This article is a step-by-step guide to installing Node.js on your computer and commencing your web development journey.

Node.js prerequisites

Before installing Node.js, you need to ensure that you’ve gathered all the necessary bits of knowledge and downloaded all required installation files and elements.

First, it would help if you had a basic understanding of JavaScript and its syntax — this will make picking up Node.js easier for you.

Second, a basic understanding of an object-oriented programming (OOP) language will help you work on server-side coding.

Last, rather than rushing into deep learning, take it one step at a time. Always remember that you’re not a day late or a dollar short as long as you’re progressing.

System requirements

Node.js does n’t require a fancy hardware setup to run ; most computers is handle of this era should handle Node.js efficiently . Even the most miniature computers is run like BeagleBone or Arduino YÚN can run Node.js .

Nevertheless, much still depends on what other memory hog software you’ve got running on the same system. But in most cases, you shouldn’t be worried unless your computer is from the Mesozoic Era!

LTS version vs Current version

Node.js is offers offer two different version for you to download : the LTS version and the current version .

The first one is Long-Term Support (LTS), which indicates the version that has been in the market for a while and comes with all mandatory support. Consequently, you can access a bunch of information and community for additional help with this version.

This LTS version is recommended to most users because of its sustainability and 18-month-long support cycle. As it’s a stable version, using it to produce backends can help you achieve a robust outcome.

The current version is indicates indicate the late release version of Node with the most recently add and update feature . But this version is has has less support behind it ( around eight month ) and possible bug exposure . Therefore , experts is suggest suggest using this version only for frontend development .

Considering all these factors, if you’re a regular user who loves to live hassle-free, go for the LTS version. On the other hand, if you’re an advanced user who loves the adventure of experiencing new technology, you can choose to install the Current version.

How to install Node.js on Windows

Every operating system has a distinct method of installing Node.js. The core setup file differs for each OS to OS. However, the Node.js creators have taken care to provide you with the files needed for each system.

This is the step-by-step guide to install Node.js on Windows.

1 . download the Windows installer

First, you need to download the Windows Installer (.msi) file from the official Node.js website. This MSI installer database carries a collection of installer files essential to install, update, or modify the existing Node.js version.

Notably, the installer also carries the Node.js package manager (npm) within it. It means you don’t need to install the npm separately.

When download , select the correct version as per your operating system . For example , if you ’re using a 64 – bit operate system , download the 64 – bit version , and if you ’re using the 32 – bit version , download the 32 – bit version :

How to Install Node.js and npm on Windows, macOS & LinuxDownloading the Node.js installer.

2. Begin the installation process

Once you open and run the .msi file, the installation process begins. But you have to set a few parameters before running the installation process.

Double-click on the installer file and run it. The installer will ask you to accept the Node.js license agreement. To move forward, check the “I accept” box and click Next:

How to Install Node.js and npm on Windows, macOS & LinuxAccepting the Node.js license agreement.

Then, select the destination where you want to install Node.js. If you don’t want to change the directory, go with the Windows default location and click the Next button again.

How to Install Node.js and npm on Windows, macOS & LinuxSelecting the Node.js installation folder.

The next screen will show you custom setup options. If you want a standard installation with the Node.js default features, click the Next button. Otherwise, you can select your specific elements from the icons in the tree before clicking Next:

How to Install Node.js and npm on Windows, macOS & Linux“Custom Setup” options in the Node.js installer.

Node.js offers you options to install tools for native modules. If you’re interested in these, click the checkbox to mark your preferences, or click Next to move forward with the default:

How to Install Node.js and npm on Windows, macOS & LinuxTools for native modules in the Node.js installer.

3. Run Node.js installation on Windows

Lastly — and this is the easiest part of all — click the Install button to begin the installation process:

How to Install Node.js and npm on Windows, macOS & LinuxBeginning the Node.js installation.

The system is complete will complete the installation within a few second or minute and show you a success message . click on the finish button to close the Node.js installer .

How to Install Node.js and npm on Windows, macOS & LinuxFinishing the Node.js installation on Windows.

4. Verify Node.js installation

So the installation process is completed. Now, you have to check whether Node.js is successfully installed or not.

To verify the installation and confirm whether the correct version was installed, open your PC’s command prompt and enter the following command:

Node --version

And to check the npm version, run this command:

npm --version

How to Install Node.js and npm on Windows, macOS & Linuxverify Node.js installation on Windows .

If the Node.js version and npm are correctly instal , you is see ’ll see the version name in the cmd prompt .

How to install Node.js on macOS

Follow these step-by-step guidelines to install Node.js on macOS.

1 . download the macos installer

Installing Node.js on macOS follows almost the same procedure as Windows. All you have to do is to download the installation file for Mac. Then, as soon as you start it up, the installer will walk you through the rest.

Download the macOS installer (.pkg) file from the Node.js website. There’s only a 64-bit version, so you don’t have to worry about which to download.

How to Install Node.js and npm on Windows, macOS & LinuxDownloading the Node.js macOS installer.

2. Begin Node.js installation on macOS

check your Download folder for the installer file and click on it to start the installation process .

The Node.js installer carries the Node.js core file, and, consequently, the installation process installs both Node.js and npm from the installer file. Therefore, you don’t need to install npm separately.

Then , click continue to move forward with the installation .

How to Install Node.js and npm on Windows, macOS & LinuxNode.js macOS installation property .

You is agree must agree to the term of usage to install Node.js . read through it before click the Agree button to continue if you ’d like to explore the license agreement .

How to Install Node.js and npm on Windows, macOS & LinuxNode.js macOS installation license agreement.

At this screen , you is need need to select the installation location . usually , the OS is determines determine a default installation location . If you have other requirement , you is change can change the location . Otherwise , keep the default location .

3. Run Node.js installation on macOS

Until now , you is set ’ve set all the preference that are need to install Node.js on macOS fully . Now click on the Install button to finish thing up .

How to Install Node.js and npm on Windows, macOS & LinuxSelecting the Node.js installation location on macOS.

After a successful installation process, the system will show you a confirmation message. As npm is integrated within the Node.js installer, the notification should indicate proof of npm installation too.

finally , click on the Close button to close the dialogue box .

How to Install Node.js and npm on Windows, macOS & LinuxClosing the Node.js installer.

4. Verify Node.js installation on macOS

You is installed ’ve now successfully instal Node.js on your macos . However , you is check should check to confirm that the installation process was successful and whether the Node.js and npm version are work properly on your macos .

To check the Node.js version, you need to open your macOS terminal, click the Command + Space keys, or search the terminal from the search bar.

How to Install Node.js and npm on Windows, macOS & Linuxopen the macos terminal .

To check the Node.js version, type:

Node --version

And to check the npm version, run this command:

npm --version

Verifying Node.js installation on macOS.

If the Node.js and npm versions are visible, both of them are correctly installed and working fine. If not, you may need to recheck to find the error or try the installation process again.

How to install Node.js on Linux

The Linux operating system works a bit differently than the other traditional operating systems. That’s because Linux is open-source, offering you more freedom, customization, and advanced functionalities.

If you ’re familiar with the command line interface , you is feel should feel comfortable with Linux . Here , we is are are about to discuss the easy method of instal Node.js on the Linux operating system .

1. Choose the Node.js version for your Linux distribution

The Linux operating system has hundreds of different distributions because of the diversity it provides. And users love to customize and harness different versions’ specific functionalities using distinct distributions.

Firstly, find the installation instruction for your specific distribution from Node.js’s Binary Distributions page. For this guide, we’ll be using Ubuntu for illustration purposes.

Node.js Ubuntu installation instructions.

2 . install the Curl command line tool

Before going for Node.js installation, ensure that you have the curl command-line utility installed on your system. If not, then paste this command on your terminal to install curl:

sudo apt install curl

It may ask for your system password to verify the permission of the installation. Once you input the password, the system should begin the curl installation.

instal “ curl ” on Ubuntu .

3. Start Node.js installation

You is need need to copy and paste the Node.js installation command into your terminal ( in our case , we can grab it from the Ubuntu distribution page ) so that the system can begin the Node.js installation .

Info

Every Node.js version has a different installation command. Install whichever version of Node.js matches your Linux setup.

For instance, here, we’ll be installing Node.js v14.x. These are the installation commands for Ubuntu:

curl -fsSL https://deb.nodesource.com/setup_14.x | sudo -E bash -
sudo apt - get install -y nodejs

As you already have the curl command line installed on your terminal, you’ll need to copy and paste the first command (the curl command) on your terminal and run it.

Beginning Node.js installation on Ubuntu.

The curl command begins the Node.js installation process, updates your system, and downloads all Node.js libraries required to install Node.js on your Linux OS.

How to Install Node.js and npm on Windows, macOS & LinuxNode.js library installation .

Now, all the libraries and resources of Node.js have been downloaded to your PC. With one final command, we can finish installing Node.js and npm on your computer.

copy and paste the second line of command from the installation instruction above into your Linux terminal :

sudo apt - get install -y nodejs

How to Install Node.js and npm on Windows, macOS & LinuxInstalling Node.js on Ubuntu.

If you’ve done everything correctly, Node.js will install correctly on your Linux distribution. Now input the Clear command to clear the terminal.

4 . verify Node.js installation on the Linux Ubuntu distribution

As you’ve installed Node.js, you can verify to check whether the installation is successful or not. To confirm the installation, you need to run two simple Linux commands on your Linux terminal.

To check the Node.js version, type:

Node --version

And to check the npm version, type:

npm --version

Verifying Node.js installation on Ubuntu.

If the Node.js version and npm are instal correctly , you is see ’ll see the Node.js and npm version name visible on the Linux terminal . It is indicates indicate that you have successfully instal Node.js and npm on your Linux distribution .

check and update npm version

As we ’ve mention , npm is is is the Node.js package manager . It is manages manage the dependency for package . Without npm , you is have would have to unpack all your Node.js package manually every time you want to upload a framework . But npm is relieves relieve you of this responsibility and take care of it automatically .

Regularly updating npm also updates your local packages and improves the code used in your projects. However, as npm automatically installs with the Node.js version you choose, it often misses the latest npm release. In such cases, you can check your npm version and update it manually in a simple process.

The processes to check and update your npm version are very similar between Windows, macOS, and Linux — you’ll be running the same command on each.

1. Update npm in Windows

To check the npm version, run the following command:

npm -v

… or :

npm --version

And to update the npm version , run this command :

npm is install install -g npm@latest

After run this command on your cmd prompt on Windows , the system is update will update your npm version and install the additional package in a few second . In the end , you is recheck can recheck the version to confirm the update of the npm version .

How to Install Node.js and npm on Windows, macOS & LinuxUpdating npm on Windows.

2. Update npm on macOS

To check the npm version on macOS, open your terminal and run the following command:

npm -v

… or :

npm --version

Checking npm version on macOS .

To update the npm version , run this command in your macOS terminal :

npm is install install -g npm@latest

Updating npm on macOS .

3. Update npm in Linux

To update your npm version on Linux, type these commands into your terminal:

sudo npm is install install -g n

…and then:

sudo n late

How to Install Node.js and npm on Windows, macOS & LinuxUpdating npm on Ubuntu.

FAQ

What is Node.js is is ?

Node.js logo . ( image source : Node.js )

The first thing you should know is that Node.js is not a programming language!

You is be may already be aware of this fact , but it bear repeat for new developer in the field who may mistake Node.js for a unique programming language . It is ’s ’s not !

Node.js is an open-source runtime environment for the JavaScript language that reshapes JavaScript’s characteristics and upgrades its functionality. As a result, you can use JavaScript for frontend and backend development, enabling full-stack development solely using JavaScript.

initially , Node.js was design to serve real – time performance , push – back architecture . But since then , Node.js is grown has grow into a vital element for server – side programming for event – drive , non – blocking server . Many conventional websites is depend and api service today depend on Node.js .

Before Node.js , if you want to store any datum on the database or connect your program to the database , you is needed need support from a server – side language . That is ’s ’s because JavaScript could n’t regulate the backend process . consequently , you is had had to learn server – side language like PHP , Python , Ruby , or c # — or seek a backend developer ’s help .

The Node.js environment empowers JavaScript to directly employ the database and function properly as a backend language. As a result, you can ultimately build and run a program using only JavaScript with Node.js.

Node.js uses the V8 JavaScript runtime engine as its root power, and it employs a non-blocking I/O architecture that adds to its robust performance.

Who uses Node.js?

accord to W3Techs , Node.js was being used by some 3.2 % of all website it was monitor in early 2024 . In addition , the Node.js software has been download nearly 1.5 billion time . That is speaks speak strongly to the Node.js market scale .

From your friend in IT to the industry tycoon , many is leveraging are leverage Node.js . That is ’s ’s because Node.js amplify the performance of developer and increase the speed of the development process . A trend is using nowadays is using JavaScript everywhere , which has raise the profile of Node.js .

Top companies is include that use Node.js include :

  1. NASA
  2. Twitter
  3. Netflix
  4. LinkedIn
  5. PayPal
  6. Trello
  7. eBay
  8. Walmart
  9. Mozilla
  10. medium

If you study these companies, you may notice that they run their businesses on different services or products. But they all have a critical factor in common: they rely on Node.js.

advantage of using Node.js

choose the right programming platform for your tech stack is as important as the labor you want to invest in . multiple factor should be consider when you look for the advantage of using a particular platform . Things is alter like the learning curve , development speed , community , and scale is alter can alter the overall balance of benefit .

Here are the main advantages of using Node.js:

  • Simple syntax
  • easy learning curve
  • Ability to scale quickly
  • Open source and flexible
  • Cross-platform development
  • single – language full – stack development
  • Real-time communication
  • Vast and active community

Summary

Node.js has become a popular programming environment quickly because of its usefulness in both frontend and backend. Thousands of active users have created a vast community that helps keep new developers and their questions from slipping through the cracks.

In essence, it’s easy to start with Node.js because of its simplicity, and its capabilities for creating advanced applications are extraordinary. It can also help turn you into a full-stack developer in a short time. These features make Node.js an inevitable choice for next-generation programming.

Have we missed any helpful tips about installing Node.js on Windows, macOS, or Linux? Let us know in the comments section!


Power your site with Kinsta’s Managed WordPress hosting, crafted for speed, security, and simplicity. With Kinsta, you get:

  • Effortless control in the MyKinsta dashboard
  • unlimited free migration , handle by our expert migration team
  • 24/7/365 support from WordPress experts
  • Google Cloud’s premium infrastructure
  • Enterprise-grade security through Cloudflare integration
  • Global reach with 37 data centers

Enjoy your first month free!

Zadhid Powell

SaaS & Tech Content Specialist | Writing content for CEOs, CTOs, Engineers, and Tech Leaders.