banner



How To Upgrade Npm Version In Windows

Introduction

Node.js is a run-fourth dimension environment which includes everything you need to execute a program written in JavaScript. It's used for running scripts on the server to render content earlier it is delivered to a spider web browser.

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

This guide will assist y'all install and update Node.js and NPM on a Windows arrangement 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 equally administrator) OR Windows PowerShell (Search > Powershell > right-click > run every bit administrator)

How to Install Node.js and NPM on Windows

Step 1: Download Node.js Installer

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

Location of download link of NodeJS installer.

Note: At that place are other versions available. If you lot have an older system, you may need the 32-bit version. You tin also use the summit link to switch from the stable LTS version to the current version. If y'all are new to Node.js or don't demand a specific version, choose LTS.

Step 2: Install Node.js and NPM from Browser

i. Once the installer finishes downloading, launch it. Open up the downloads link in your browser and click the file. Or, browse to the location where you accept saved the file and double-click it to launch.

two. The system will ask if yous want to run the software – click Run.

3. You will be welcomed to the Node.js Setup Magician – click Next.

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

five. The installer will prompt you for the installation location. Leave the default location, unless you have a specific demand to install it somewhere else – then click Next.

6. The wizard will let yous select components to include or remove from the installation. Again, unless you have a specific need, accept the defaults past clicking Side by side.

seven. Finally, click the Install push to run the installer. When it finishes, click Finish.

Step iii: Verify Installation

Open a control prompt (or PowerShell), and enter the following:

          node -five        

The system should display the Node.js version installed on your system. You tin can do 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 easiest way to update Node.js and NPM is to download the latest version of the software. On the Node.js download page, correct below the Windows Installer link, information technology will display the latest version. You can compare this to the version you have installed.

To upgrade, download the installer and run information technology. The setup wizard volition overwrite the quondam version, and supervene upon it with the new version.

How to Uninstall Node.js and NPM on Windows

You can uninstall Node.js from the Control Panel in Windows.

To do 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.

Bones Node.js Usage

Node.js is a framework, which ways that it doesn't piece of work every bit a normal application. Instead, it interprets commands that you write. To exam your new Node.js installation, create a Hello World script.

1. Showtime by launching a text editor of your choice.

2. Next, copy and paste the post-obit into the text editor y'all've only opened:

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

three. Save the file, then exit. Open the PowerShell, and enter the following:

          node \users\<your_username>\myprogram.js        

Information technology will look like nil has happened. In reality, your script is running in the groundwork. You lot may come across a Windows Defender find about allowing traffic – for now, click Allow.

iv. Adjacent, open a web browser, and enter the following into the address bar:

          http://localhost:8080        

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

Right now, your calculator is acting similar a server. Any other computer that tries to admission your organisation on port 8080 will see the Hello Globe notice.

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

Conclusion

You 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 dissimilar JavaScript solutions, which can exist found at npmjs.com.

Was this article helpful?

Aye No

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

Posted by: jacksoninswer.blogspot.com

0 Response to "How To Upgrade Npm Version In Windows"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel