A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.geeksforgeeks.org/installation-guide/install-node-js-windows-macos-linux/ below:

How To Install NodeJS on Your System?

To run JavaScript outside a browser or use frameworks like React or Express, you need Node.js. Let's see how to install Node.js on Windows, Linux, and Mac systems, ensuring you’re ready for JavaScript development.

Installing Node.js on Windows

In this section, we'll discuss the three different methods that can used to download and install Node.js for Windows users.

1. Download and Install Node.js from the Official Website Step 1: Download the Node.js Installer

Visit the official Node.js download page and choose your suitable download either long-term support (LST) version 22.12.0 or the current version v23.3.0

Official website Step 2: Run the Node Installer

Open the .msi installer once downloaded.

msi installer

During installation, make sure to add Node.js to your PATH to ensure that both Node.js and npm are accessible globally in the command line.

Step 3: Verify Installation

Open Command Prompt and run the following to check if Node.js and npm are correctly installed:

node -v
npm -v

This will display the installed versions of Node.js and npm.

2. Install Using Windows Package Manager (Winget) Step 1: Open PowerShell as Administrator

Right-click the Start menu and select Windows PowerShell (Admin).

Admin Access Step 2: Install Node.js via Winget

Execute the following command to install Node.js:

winget install OpenJS.Node.js
PowerShell

Also, check the installed versions of Node.js and npm once the installation is complete using the following command:

node -v
npm -v
3. Install using WSL(2) *recommended Step 1: Enable WSL (Windows Subsystem for Linux)

Open PowerShell as Administrator and run the following command:

wsl --install
WSL

Choose your preferred Linux distribution (Ubuntu is widely used).

Step 2: Install Node.js on WSL

Once your Linux subsystem is set up, you can install Node.js via your chosen Linux distribution:

WSL
sudo apt update
sudo apt install Node.js npm

Later, you can run the following commands to verify the installation:

node -v
npm -v
Install Node.js on macOS

You may download and install node on macOS using these 3 defined methods below, let's check them out along with their steps:

1. Download and Install Node.js via Homebrew Step 1: Install Homebrew

Open Terminal and run the following command to install homebrew version 23.3.0 (if you haven’t already):

Brew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Step 2: Install Node.js

After Homebrew is installed, run the following command to install Node.js:

Terminal
brew install node

Once the installation is complete, you may check if Node.js and npm are successfully installed by running:

node -v
npm -v
verify 2. Install Node.js from the Official Website

Node js offer users to get the download done from it's official website as well and this might be the simplest method to download and install Node in your system.

Step 1: Download the macOS Installer v23.3.0

Visit the Node.js official site and download the macOS installer for either the LTS v22.12.0 or Current version v23.3.0

Node Step 2: Run the Installer

Open the downloaded .pkg file and follow the instructions to complete the installation.

Extract .pkg Step 3: Verify Installation

Once installed, open Terminal and check the Node.js and npm versions:

node -v
npm -v
Verify the installer 3. Install Node.js Using NVM

Step 1: Install NVM

Run the following command to install NVM (a version manager for Node.js):

macOS
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash

Step 2: Install Node.js Using NVM v22.12.0 (LTS)

After NVM is installed, you can install any version of Node.js:

nvm install node  # Installs the latest version of Node.js

Also, you can verify Installation using the following command

node -v
npm -v
verify Install Node.js on Linux

Now, we'll be discussing the 3 methods to Install Node on your Linux system.

1. Install Node.js Using APT (For Ubuntu/Debian-based Distributions) Step 1: Update the Package List v22.12.0 (LTS)

Go to Terminal and execute the following command:

sudo apt
sudo apt update
Step 2: Install Node.js on your System

Now, run the following command to Install Node.js and npm:

sudo Install
sudo apt install Node.js npm
Step 3: Verify Installation

Once the installation is complete, you may check the installed versions using the following command:

node -v
npm -v
2. Install Node.js Using DNF (For Fedora) Step 1: Install Node.js for Fedora 41

Open Terminal and run

sudo
sudo dnf install Node.js
Step 2: Verify Installation

After installation, verify Node.js and npm by using the following command:

node -v
npm -v
verify 3. Install Node using NVM Step 1: Install NVM v22.12.0 (LTS)

Run this command to install NVM, which helps manage different versions of Node.js:

install.sh
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
Step 2: Install Node using NVM

After installing NVM, run

nvm install node  # Installs the latest version
Installation Step 3: Verify Installation

Run the following command to verify node installation:

node -v
npm -v
verify installation Troubleshooting Common Issues Issue 1: Node.js Not Added to PATH

If node or npm commands are not recognized, ensure Node.js is added to your system’s PATH. This is particularly common with manual installation methods.

Issue 2: Permission Errors

When installing Node.js globally, you may face permission issues. You can resolve this by running the commands with sudo (on Linux/macOS) or by using an administrator account (on Windows). Alternatively, use NVM to avoid these problems.

Issue 3: Outdated Versions

If you're using an outdated version of Node.js or npm, you can upgrade to the latest version by running:

npm install -g npm
Key Takeaways

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4