Exercise 1 - Download-and-Install-Nodejs-npm
Exercise 1 - Download-and-Install-Nodejs-npm
Node.js is a server-side JavaScript code execution environment, while npm (Node Package
Manager) is a package management tool for Node.js. To develop JavaScript applications or run
Node.js-related tools, you need to download and install both Node.js and npm on your computer.
At the end of this exercise, you would be able to:
Installing Node
Downloading and installing Node.js and npm includes the following steps:
Run the installation package and follow the on-screen instructions to complete the
installation.
Verify the installation was successful by opening a terminal and running the Node.js and
npm version check commands.
Guidelines
Step 2: On the website, you will see two recommended Node.js versions: LTS (Long-Term
Support) and Current. For general purposes, choose the LTS version for stability and long-term
support.
Page 1
Step 3: Click on the Node.js LTS version to download the installation package.
Step 4: Once the installation file has been downloaded, run the installation file to start the
installation process.
For Windows: Double-click the installation file (.msi) and follow the onscreen instructions.
Select the appropriate installation path and options.
For macOS: Open the installation file (.pkg) and follow the onscreen instructions. Select the
appropriate installation path and options.
For Linux: Open terminal, navigate to the directory containing the installation files and run the
following command to install:
(Replace "installation_filename.deb" with the actual name of the installation file you
downloaded)
Step 5: Once the installation is complete, check the installed Node.js version by opening a
terminal and running the following command:
node -v
Step 6: Next, to test the npm installation, run the following command in terminal:
npm -v
Page 2
Conclusions
Downloading and installing Node.js and npm is an important process for developing and running
Node.js-related JavaScript applications. By following the above instructions, you can
successfully set up a Node.js development environment on your computer.
Page 3