A Beginner's Guide to Installing Node.js
Leroy - Oct 4, 2023 - 1 min read
Table of Contents
Installing Node.js
Node.js is a popular runtime for executing JavaScript code on the server-side. Follow these steps to install Node.js on your system:
Step 1: Download Node.js
Visit the official Node.js website at nodejs.org to download the Node.js installer for your operating system.
- For Windows, download the LTS (Long Term Support) version or the latest version for the Windows platform.
- For macOS, download the LTS version or the latest version for macOS.
- For Linux, you can use your system's package manager to install Node.js, but it's recommended to download and install the official Node.js distribution for better version control.
Step 2: Run the Installer
Windows
- Double-click the downloaded installer.
- Follow the installation prompts. You can choose the default settings.
macOS
- Double-click the downloaded package file (e.g.
node-vX.X.X.pkg). - Follow the installation prompts. You can choose the default settings.
Linux
Use your system's package manager to install Node.js. However, for better control and access to the latest version, consider using a version manager like nvm (Node Version Manager) on Linux.
Step 3: Verify Installation
To verify that Node.js and npm (Node Package Manager) have been installed successfully, open a terminal or command prompt and run the following commands:
node --version
npm --version
These commands should display the installed Node.js and npm versions.
Step 4: Install Global Packages (Optional)
You can install global packages using npm for development purposes. For example, to install the popular npm package globally, run:
npm install -g npm
Congratulations! You've successfully installed Node.js and npm on your system. You're now ready to develop and run JavaScript applications using Node.js.