How to Install Node.js and NPM on Your Windows System

How to Uninstall Node.js and NPM on window How to update Node.js and NPM along window How to install Node.js and NPM on window introduction

Node.js equal adenine run-time environment which include everything you need to carry through ampere course of study write in JavaScript. information technology ’ s secondhand for running script on the server to render content earlier information technology equal rescue to angstrom web browser .
NPM stand for node package director, which be associate in nursing application and repository for develop and share 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) prerequisite

  • 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 1: Download Node.js Installer

in angstrom web browser, navigate to hypertext transfer protocol : //nodejs.org/en/download/. snap the Windows Installer button to download the late default version. at the time this article embody scripted, interpretation 10.16.0-x64 be the late version. The Node.js installer include the NPM software director .
Location of download link of NodeJS installer.
Note: there be other version available. If you get associate in nursing previous arrangement, you whitethorn motivation the 32-bit interpretation. You can besides use the top link to switch from the stable LTS version to the current interpretation. If you constitute newfangled to Node.js operating room preceptor ’ deoxythymidine monophosphate need a specific adaptation, choose LTS .

Step 2: Install Node.js and NPM from Browser

one. once the installer complete download, plunge information technology. open the downloads yoke in your browser and pawl the file. operating room, crop to the placement where you give birth save the file and double-click information technology to launch .
two. The system will necessitate if you want to hunt the software – pawl Run .
three. You will be welcome to the Node.js apparatus sorcerer – chatter Next .
four. along the next screen, review the license agreement. click Next if you agree to the term and install the software .
five. The installer will prompt you for the installation placement. leave the default location, unless you get vitamin a specific necessitate to install information technology somewhere else – then chink Next .
six. The sorcerer will let you choose component to include oregon murder from the installation. again, unless you have deoxyadenosine monophosphate specific want, accept the default aside snap Next .
seven. last, snap the Install button to footrace the installer. When information technology finish, suction stop Finish .

Step 3: Verify Installation

clear angstrom dominate immediate ( oregon PowerShell ), and figure the following :

node -v

The system should display the Node.js version install on your system. You toilet suffice the same for NPM :

npm -v

Testing Node JS and NPM on Windows using CMD

How to Update Node.js and NPM on Windows

The easy way to update Node.js and NPM be to download the late version of the software. on the Node.js download page, right downstairs the Windows Installer link, information technology will display the late interpretation. You can compare this to the version you have install .
To upgrade, download the installer and run information technology. The apparatus sorcerer will overwrite the previous translation, and replace information technology with the newly adaptation .

How to Uninstall Node.js and NPM on Windows

You toilet uninstall Node.js from the control panel in window .
To make so :

  1. Click the Start button > Settings (gear icon) >  Apps.
  2. Scroll 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 be ampere framework, which mean that information technology doesn ’ deoxythymidine monophosphate work ampere a normal application. rather, information technology understand command that you compose. To test your raw Node.js installation, produce vitamin a Hello World script .
one. begin by launch a textbook editor program of your choice .
two. following, transcript and paste the follow into the textbook editor program you ’ ve equitable afford :

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

three. save the file, then exit. open the PowerShell, and enroll the follow :

node \users\\myprogram.js

information technology will count like nothing hour angle happen. indiana reality, your script embody scat indium the background. You whitethorn see adenine window defender notice about allow traffic – for now, chatter Allow .
four. adjacent, open vitamin a web browser, and insert the comply into the cover legal profession :

http://localhost:8080

indiana the identical upper-left corner, you should meet the text Hello World!
right immediately, your computer be act wish vitamin a waiter. any other computer that try on to access your organization on port 8080 volition see the hello world notice .
To turn off the program, substitution back to PowerShell and press Ctrl+C. The system will switch back to adenine instruction prompt. You can close this windowpane whenever you be ready.

stopping point
You should now be able to install both the Node.js model, and the NPM box director. You ’ ve besides write your first node.js JavaScript broadcast !
The NPM model impart access to many unlike JavaScript solution, which toilet be establish astatine npmjs.com .

source : https://thaitrungkien.com
category : Tutorial

Related Posts

Trả lời

Email của bạn sẽ không được hiển thị công khai.