Node.js installation guide
This guide explains how to install Node.js
as a development platform.
Installation in Mac OS
Section titled “Installation in Mac OS”Method 1: Using Homebrew 1.
Section titled “Method 1: Using Homebrew 1.”-
If you do not have Homebrew installed, open terminal and run the following command.
Terminal window /bin/bash -c “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)”Once the Homebrew installation is complete, proceed as follows:
-
To install Node.js, run the following command in terminal.
Terminal window brew install node
Method 2: Using Volta
Section titled “Method 2: Using Volta”Volta is a Node.js version control tool made in Rust.
It is officially described as “a hassle-free JavaScript tool manager”.
To install it the normal way
Section titled “To install it the normal way”Open terminal and run the following command
curl https://get.volta.sh | bash
To install using Homebrew
Section titled “To install using Homebrew”Open terminal and run the following command.
brew install volta
Passing the PATH
Section titled “Passing the PATH”You need to pass the PATH, so execute the following command.
Include the following in your .zshrc.
export VOLTA_HOME=“$HOME/.volta”export PATH=“$VOLTA_HOME/bin:$PATH”
How to confirm installation
Section titled “How to confirm installation”volta --version
If you see the version of Volta as follows, you are done.
1.1.1
Installing Node.js
Section titled “Installing Node.js”To install the latest version
volta install node
To install a specific version:
volta install node@20.11.0
Method 3: Download the installer from the official Node.js website
Section titled “Method 3: Download the installer from the official Node.js website”- Go to the official Node.js website
- Click “Download Node.js” to download the recommended version of the installer.
- Open the downloaded file and follow the instructions to complete the installation. The method is the same for Mac OS, Windows, and Linux.
To download the installer by specifying the version, you can download it from here.
Confirmation after installation
Section titled “Confirmation after installation”To check if the installation was successful, run the following command in Terminal (Mac) or Command Prompt (Windows).
node -vnpm -v
These commands will show you the installed versions of Node.js and npm. If you see the output, the installation was successful.