DEV Community

mrchiraggarg
mrchiraggarg

Posted on • Originally published at Medium

Node.js Installation Guide

Hello, Fellow Developer!

If you’re reading this blog, you’re likely a beginner or maybe you’ve run into some hiccups trying to install Node.js. Don’t worry — you’re in the right place! I’m here to guide you through the entire Node.js installation process in a simple, hassle-free way, whether you’re on Windows, Ubuntu Linux, or macOS.

Before we dive in:

Node.js is a powerful, open-source, cross-platform JavaScript runtime environment that lets you run JavaScript code outside of a browser. It’s an essential tool for backend development, building scalable servers, and using npm (Node Package Manager) to manage your packages. No matter your platform, with this step-by-step guide, you’ll have Node.js and npm up and running in no time.

Installing Node.js on Windows

Getting Node.js on Windows is pretty straightforward:

Head to the official Node.js website and download the recommended LTS (Long Term Support) Windows installer (.msi).
Run the installer, accept the license agreement, and follow the prompts. Make sure to check the box that adds Node.js to your system PATH so you can run it from the command line easily.
Once installed, open Command Prompt and verify your installation by running:
node -v
npm -v

You should see version numbers — meaning you’re good to go!

Installing Node.js on Ubuntu Linux

Ubuntu users, the best way to install Node.js is using Node Version Manager (nvm), which lets you easily switch between Node.js versions:

  1. Open your terminal and install nvm with:
    curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash

  2. After installation, restart your terminal or run:
    source ~/.bashrc

  3. Then install the latest Node.js version with:
    nvm install node

  4. Verify installation:
    node -v

npm comes bundled with Node.js, so no extra setup needed.

If you prefer, you can also install Node.js directly from Ubuntu’s package manager, but it might not have the latest version:
sudo apt update
sudo apt install nodejs npm

Installing Node.js on macOS

Mac users have two great options: the official installer or Homebrew package manager.

Option 1: Official Installer
Download the macOS installer (.pkg) from the Node.js website.
Run it, follow the steps, and Node.js plus npm will be installed.
Check installation in Terminal:
node -v
npm -v

Option 2: Using Homebrew

  1. If you don’t have Homebrew yet, install it with:
    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

  2. Then install Node.js:
    brew install node

  3. Verify with:
    node -v
    npm -v

Why Use nvm?

If you intend to work with different Node.js projects that might require different Node versions, nvm (Node Version Manager) is your friend. It’s available on Linux and macOS and lets you install, update, and switch between Node.js versions with ease. For Windows, there’s a similar tool called nvm-windows.

If you’ve followed along and reached this point, congratulations — you now know how to install Node.js and npm on your system!

If you’ve found this guide helpful, I’d love to connect with you! You can find me on these platforms — feel free to reach out, follow, or check out my work:

Portfolio | LinkedIn | GitHub | X (formerly Twitter) | Instagram | Facebook

Connecting with you on these platforms keeps me inspired, and your support motivates me to keep sharing more valuable content.

I wish you all the best on your coding journey! If you enjoyed this guide, please show your support by showing your reaction for this blog and hitting the follow button. Your encouragement inspires me to continue creating helpful content like this.

If you found me helpful and want to treat me, you can buy me a coffee to help me stay active and keep posting more great content proactively.

*Thank you so much for reading, and for being part of this journey!
*

Top comments (0)