Installing Node.js is a simple process that varies slightly based on your operating system. Here’s how to do it for the major ones:
For Windows:
1. Download the Windows installer from the Nodes.js website: https://nodejs.org
2. Once downloaded, run the installer (the .msi file you just downloaded).
3. Follow the instructions provided by the Node.js Setup Wizard.
4. To confirm it’s properly installed, open a command prompt and type `node -v`. This should print the version number of your installed Node.js.
For macOS:
Use Homebrew, a package manager for macOS that easily manages the software you install:
1. Install Homebrew by typing `/bin/bash -c “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)”` in Terminal.
2. After the installation is finished, type `brew install node`.
For Ubuntu:
Node.js package is available in the Ubuntu repository, but it might not be the most recent. For up-to-date version, use NodeSource’s Personal Package Archive (PPA):
1. Open Terminal (ctrl + alt + t).
2. Run `sudo apt update`.
3. Run `curl -sL https://deb.nodesource.com/setup_15.x | sudo -E bash -`. (Replace “15” with the version you want.)
4. Run `sudo apt-get install -y nodejs`.
After installation: Verify your installation by typing `node -v` in Terminal or Command Prompt, which should print the version number of your installed Node.js.