banner



How To Install Nodejs On Windows 10

Introduction

Node.js is a run-time surround which includes everything you lot need to execute a plan written in JavaScript. It's used for running scripts on the server to return content earlier it is delivered to a spider web browser.

NPM stands for Node Parcel Manager, which is an application and repository for developing and sharing JavaScript code.

This guide will help you install and update Node.js and NPM on a Windows system and other useful Node.js commands.

Tutorial on how to install, use, update and remove Node.JS and NPM (Node package manager)

Prerequisites

  • A user account with administrator privileges (or the ability to download and install software)
  • Access to the Windows command line (search > cmd > right-click > run as administrator) OR Windows PowerShell (Search > Powershell > right-click > run as administrator)

How to Install Node.js and NPM on Windows

Step i: Download Node.js Installer

In a web browser, navigate to https://nodejs.org/en/download/. Click the Windows Installer push button to download the latest default version. At the fourth dimension this article was written, version 10.16.0-x64 was the latest version. The Node.js installer includes the NPM package director.

Location of download link of NodeJS installer.

Annotation: There are other versions available. If you accept an older system, yous may need the 32-bit version. You can as well use the top link to switch from the stable LTS version to the current version. If y'all are new to Node.js or don't need a specific version, choose LTS.

Stride ii: Install Node.js and NPM from Browser

1. One time the installer finishes downloading, launch it. Open the downloads link in your browser and click the file. Or, browse to the location where y'all have saved the file and double-click it to launch.

ii. The organisation will ask if y'all desire to run the software – click Run.

3. Yous volition exist welcomed to the Node.js Setup Sorcerer – click Next.

four. On the next screen, review the license agreement. Click Next if yous agree to the terms and install the software.

5. The installer will prompt you for the installation location. Leave the default location, unless you have a specific need to install it somewhere else – then click Side by side.

6. The wizard will let y'all select components to include or remove from the installation. Over again, unless y'all have a specific need, accept the defaults by clicking Adjacent.

7. Finally, click the Install button to run the installer. When it finishes, click Finish.

Stride 3: Verify Installation

Open a command prompt (or PowerShell), and enter the post-obit:

          node -five        

The organisation should brandish the Node.js version installed on your arrangement. Y'all tin can practice the aforementioned for NPM:

          npm -v        
Testing Node JS and NPM on Windows using CMD

How to Update Node.js and NPM on Windows

The easiest style to update Node.js and NPM is to download the latest version of the software. On the Node.js download folio, correct below the Windows Installer link, information technology will display the latest version. Yous can compare this to the version y'all have installed.

To upgrade, download the installer and run it. The setup wizard will overwrite the onetime version, and supercede it with the new version.

How to Uninstall Node.js and NPM on Windows

You lot can uninstall Node.js from the Control Console in Windows.

To do and so:

  1. Click the Start push > Settings (gear icon) > Apps.
  2. Ringlet down to find Node.js and click to highlight.
  3. Select Uninstall. This launches a wizard to uninstall the software.

Basic Node.js Usage

Node.js is a framework, which means that information technology doesn't work as a normal application. Instead, it interprets commands that you write. To test your new Node.js installation, create a Hello World script.

1. Start by launching a text editor of your option.

2. Side by side, copy and paste the post-obit into the text editor you've just opened:

          var http = crave('http');  http.createServer(function (req, res) {    res.writeHead(200, {'Content-Type': 'text/html'});    res.end('Hello World!');  }).mind(8080);        

3. Save the file, and so get out. Open up the PowerShell, and enter the following:

          node \users\<your_username>\myprogram.js        

It will await like aught has happened. In reality, your script is running in the groundwork. You may run into a Windows Defender notice about allowing traffic – for now, click Permit.

4. Next, open up a spider web browser, and enter the following into the accost bar:

          http://localhost:8080        

In the very upper-left corner, you lot should see the text Hello World!

Right now, your computer is acting similar a server. Any other computer that tries to access your system on port 8080 will see the Hello Earth discover.

To turn off the program, switch back to PowerShell and printing Ctrl+C. The system will switch back to a command prompt. You can close this window whenever you are set.

Conclusion

Yous should now be able to install both the Node.js framework, and the NPM package director. You've also written your first node.js JavaScript program!

The NPM framework gives access to many different JavaScript solutions, which tin be found at npmjs.com.

Was this commodity helpful?

Aye No

Source: https://phoenixnap.com/kb/install-node-js-npm-on-windows

Posted by: besterappause1966.blogspot.com

0 Response to "How To Install Nodejs On Windows 10"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel