Skip to Content

Node.js

Node.js is a JavaScript runtime that allows you to run JavaScript code outside of a web browser. It’s built on Chrome’s V8 JavaScript engine and is widely used for building fast, scalable server-side and networking applications. With Node.js, you can develop full-stack applications using JavaScript.

Table of Contents

Installation

Using a version manager like fnm or nvm is the best option as it allows you to easily switch between different versions of Node.js, which is helpful when working on multiple projects that may require different versions.

Note

For Laragon users, Node.js is already available. Just launch Laragon > Terminal and type node --version to verify.

Option 1: Using choco

Step 1: Open your terminal as Administrator.

  • Press Windows Key + X and select Windows PowerShell (Admin) or Command Prompt (Admin).
  • Click Yes if prompted by the User Account Control dialog.

Step 2: Install fnm using command:

terminal
# for `fnm` choco install fnm -y # for `nvm` choco install nvm -y
Note

The -y flag automatically accepts all prompts, making the installation seamless.

Option 2: Using scoop

Step 1: Open your Terminal.

  • You don’t need to run Terminal as an administrator for Scoop.

Step 2: Install using command:

terminal
# for `fnm` scoop install fnm # for `nvm` scoop install nvm

Option 3: Using Homebrew

Step 1: Open your Terminal.

Step 2: Install fnm using command:

terminal
# for `fnm` brew install fnm # for `nvm` brew install nvm

Step 3: Verify Node.js Version Manager

  • You can verify that you have installed by running the following command:
terminal
# for `fnm` fnm --version # for `nvm` nvm --version

If you see a version number, that means it is installed!

Install Latest Node.js Version

Start installing the latest version of Node.js using the version manager you installed.

Option 1: Using fnm

Step 1: Open your terminal.

Step 2: Install the latest version of Node.js using the following command:

terminal
fnm install --latest

Wait for the installation to complete.

Step 3: Activate the installed version using the following command:

terminal
fnm use latest

Step 4: Verify the installation by running the following command:

terminal
node --version

You can visit fnm.vercel.app for a more comprehensive guide.

Option 2: Using nvm

Step 1: Open your terminal.

Step 2: Install the latest version of Node.js using the following command:

terminal
nvm install --lts

Step 3: Activate the installed version using the following command:

terminal
nvm use --lts

Step 4: Verify the installation by running the following command:

terminal
node --version

Visit nvm.sh for a more comprehensive guide.

Last updated on