Table of contents
Open Table of contents
How to Install Node.js
Node.js is a powerful JavaScript runtime that allows you to build scalable server-side applications. To get started with Node.js, you need to install it on your machine. In this guide, we will walk you through the steps to install Node.js on different operating systems.
Windows Installation
- Visit the official Node.js website: Node.js Official Website
- Click on the “Downloads” button to access the downloads page.
- Choose the appropriate Windows installer based on your system architecture (32-bit or 64-bit).
- Run the downloaded installer and follow the prompts in the installation wizard.
- Once the installation is complete, open the command prompt and type
node -v
to verify the installation. You should see the Node.js version number.
For more detailed instructions, refer to the official Node.js documentation for Windows installation.
macOS Installation
- Visit the official Node.js website: Node.js Official Website
- Click on the “Downloads” button to access the downloads page.
- Choose the appropriate macOS installer based on your system architecture.
- Run the downloaded installer and follow the prompts in the installation wizard.
- Once the installation is complete, open the terminal and type
node -v
to verify the installation. You should see the Node.js version number.
For more detailed instructions, refer to the official Node.js documentation for macOS installation.
Linux Installation
The process of installing Node.js on Linux can vary depending on the distribution you are using. Here’s a general approach:
- Open the terminal.
- Update the package manager using the appropriate command based on your distribution (e.g.,
sudo apt update
for Ubuntu). - Install Node.js using the package manager. For example, on Ubuntu, you can run
sudo apt install nodejs
. - Verify the installation by typing
node -v
in the terminal. You should see the Node.js version number.
For more specific instructions based on your Linux distribution, refer to the official Node.js documentation for Linux installation.
Verifying the Installation
To ensure that Node.js is installed correctly, open a terminal or command prompt and run the following commands:
node -v
This command will display the installed version of Node.js. Additionally, you can verify the installation of the Node Package Manager (NPM) by running:
npm -v
This command will display the version of NPM installed on your system.
Conclusion
Congratulations! You have successfully installed Node.js on your machine. Now you can start building powerful server-side applications using JavaScript. If you encounter any issues during the installation process, refer to the official Node.js documentation for troubleshooting or seek help from the Node.js community.
Happy coding with Node.js!