Summary: in this tutorial, you will learn how to install Node.js on your computer.
Download Node.js
To download Node.js, you go to the download page on the Node.js website.
Node.js supports multiple platforms, including Windows, macOS, and Linux. You need to choose the installer suitable for your platform.
Node.js has two actively supported releases:
- Long-Term Support (LTS)
- Current
If you develop real-use applications, you should only use the LTS releases. The LTS release is recommended for most users.
Generally, LTS releases guarantee that critical bugs will be fixed for 30 months. The Major Node.js enters the Current release status for six months.
If you want to run multiple versions of Node.js on a single computer, you can use the Node Version Manager (NVM). Check out the NVM on Windows and macOS.
Install Node.js on Windows
To install Node.js on Windows, double-click the installer file you have downloaded to launch the setup wizard.
First, the setup wizard will compute space requirements:
After completed, you click the Next button to go to the next step:
Second, accept the end-user license agreement and click the Next button.
Third, select a folder to install Node.js and click the Next button. It defaults to C:\Program Files\nodejs\
.
Fourth, select the features you want to install and click the Next button. If you leave the default options, the setup wizard will install Node.js runtime, npm package manager, and online documentation shortcuts. It also adds the C:\Program Files\nodejs\
folder to the PATH
:
Fifth, select the checkbox to install the necessary tools, including Chocolatey. If you don’t know what it is, leave it unchecked and click the Next button.
Sixth, click the Install button to begin the installation.
Seventh, you need to wait for the setup wizard to install Node.js:
Eight, click the Finish button to exit the setup wizard.
To confirm the installation, you can open Command Prompt or Windows Terminal and type the following command:
node -v
It will show the installed version of Node.js. If you type node, it will launch a REPL and put you in an interactive JavaScript environment. In this interactive mode, you can execute any valid JavaScript code.
> 'hello'.length
5
> 'hello'.toUpperCase();
'HELLO'
>
Code language: JavaScript (javascript)
To escape the interactive mode, you type the .exit
command:
>.exit
Code language: CSS (css)
In this tutorial, you have learned how to download and install Node.js on your computer.