Conteúdo do Curso
Node.js Express: API & CLI Apps
4. Developing REST API
Node.js Express: API & CLI Apps
Installing Node.js
Now that we understand what Node.js is and its purpose, it's time to roll up our sleeves and get our hands on the real deal. As Node.js is a JavaScript runtime environment, installing it on your local machine is highly recommended.
System Requirements
Before diving in, let's quickly check the system requirements to ensure your computer is ready to handle Node.js:
- 🪟 Windows: Windows 7 or later;
- 🍏 macOS: macOS 10.12 (Sierra) or later;
- 🐧 Linux: A modern Linux distribution with GLIBC version 2.17 or later, along with development tools (GCC, G++, etc.) for compiling native addons.
Note
Node.js and npm (Node Package Manager) are often installed together, as npm comes bundled with Node.js.
Installing Node.js
Here's a step-by-step guide on how to install Node.js on your machine:
Step 1: Visit the Official Website
Open the web browser and go to the official Node.js website at https://nodejs.org/.
Step 2: Download Node.js
Two main versions are available: LTS (Long-Term Support) and Current. We recommend installing the LTS version for most users, as it's stable and widely used.
- Click on the "Downloads" tab on the Node.js website.
- The website will automatically detect your operating system and recommend the appropriate LTS version. If not, select the LTS version from the options provided.
- Click the "LTS" button to initiate the installer download for your operating system.
Step 3: Installation
Windows Instructions
- Locate the downloaded Node.js installer (e.g., node-vXX.XX.X-x64.msi) on your computer and double-click it to begin the installation process;
-
Follow the setup wizard's instructions:
- Click "Next" to continue;
- Accept the license agreement and click "Next";
- Choose the destination folder for Node.js installation or stick with the default location. Click "Next";
- Keep the default options, including npm, selected. Click "Next";
- Choose whether to include the Node.js runtime in the system's PATH environment variable. Select "Automatically" for most cases. This allows you to run Node.js from any command prompt. Click "Next";
- Click "Install" to start the installation;
- Once the installation is complete, click "Finish" to exit the setup wizard.
macOS Instructions
- Locate the downloaded Node.js package (e.g., node-vXX.XX.X.pkg) on your computer and double-click it to start the installation;
-
Follow the package installer's instructions:
- Click "Continue" to proceed;
- Read and accept the license agreement;
- Choose the installation destination. The default location should be suitable for most users. Click "Continue";
- Click "Install" to begin the installation. You may need to enter your computer's password to proceed;
- Once the installation is complete, click "Close" to exit the installer.
Linux Instructions
For Linux users, the installation process can vary based on your distribution. Most distributions offer Node.js through their package repositories.
- Open a terminal on your Linux system;
-
Use the package manager specific to your distribution to install Node.js. For example:
- On Ubuntu/Debian:
sudo apt install nodejs
; - On Fedora:
sudo dnf install nodejs
; - On CentOS/RHEL:
sudo yum install nodejs
.
- On Ubuntu/Debian:
-
Verify the installation by checking Node.js and npm versions:
- To check Node.js:
node -v
; - To check npm:
npm -v
.
- To check Node.js:
Congratulations! You've successfully installed Node.js on your computer using the recommended LTS version. 🎉 In the next chapter, we'll dive into the fascinating Node.js ecosystem and learn how to create your first Node.js application.
Tudo estava claro?
Conteúdo do Curso
Node.js Express: API & CLI Apps
4. Developing REST API
Node.js Express: API & CLI Apps
Installing Node.js
Now that we understand what Node.js is and its purpose, it's time to roll up our sleeves and get our hands on the real deal. As Node.js is a JavaScript runtime environment, installing it on your local machine is highly recommended.
System Requirements
Before diving in, let's quickly check the system requirements to ensure your computer is ready to handle Node.js:
- 🪟 Windows: Windows 7 or later;
- 🍏 macOS: macOS 10.12 (Sierra) or later;
- 🐧 Linux: A modern Linux distribution with GLIBC version 2.17 or later, along with development tools (GCC, G++, etc.) for compiling native addons.
Note
Node.js and npm (Node Package Manager) are often installed together, as npm comes bundled with Node.js.
Installing Node.js
Here's a step-by-step guide on how to install Node.js on your machine:
Step 1: Visit the Official Website
Open the web browser and go to the official Node.js website at https://nodejs.org/.
Step 2: Download Node.js
Two main versions are available: LTS (Long-Term Support) and Current. We recommend installing the LTS version for most users, as it's stable and widely used.
- Click on the "Downloads" tab on the Node.js website.
- The website will automatically detect your operating system and recommend the appropriate LTS version. If not, select the LTS version from the options provided.
- Click the "LTS" button to initiate the installer download for your operating system.
Step 3: Installation
Windows Instructions
- Locate the downloaded Node.js installer (e.g., node-vXX.XX.X-x64.msi) on your computer and double-click it to begin the installation process;
-
Follow the setup wizard's instructions:
- Click "Next" to continue;
- Accept the license agreement and click "Next";
- Choose the destination folder for Node.js installation or stick with the default location. Click "Next";
- Keep the default options, including npm, selected. Click "Next";
- Choose whether to include the Node.js runtime in the system's PATH environment variable. Select "Automatically" for most cases. This allows you to run Node.js from any command prompt. Click "Next";
- Click "Install" to start the installation;
- Once the installation is complete, click "Finish" to exit the setup wizard.
macOS Instructions
- Locate the downloaded Node.js package (e.g., node-vXX.XX.X.pkg) on your computer and double-click it to start the installation;
-
Follow the package installer's instructions:
- Click "Continue" to proceed;
- Read and accept the license agreement;
- Choose the installation destination. The default location should be suitable for most users. Click "Continue";
- Click "Install" to begin the installation. You may need to enter your computer's password to proceed;
- Once the installation is complete, click "Close" to exit the installer.
Linux Instructions
For Linux users, the installation process can vary based on your distribution. Most distributions offer Node.js through their package repositories.
- Open a terminal on your Linux system;
-
Use the package manager specific to your distribution to install Node.js. For example:
- On Ubuntu/Debian:
sudo apt install nodejs
; - On Fedora:
sudo dnf install nodejs
; - On CentOS/RHEL:
sudo yum install nodejs
.
- On Ubuntu/Debian:
-
Verify the installation by checking Node.js and npm versions:
- To check Node.js:
node -v
; - To check npm:
npm -v
.
- To check Node.js:
Congratulations! You've successfully installed Node.js on your computer using the recommended LTS version. 🎉 In the next chapter, we'll dive into the fascinating Node.js ecosystem and learn how to create your first Node.js application.
Tudo estava claro?