by Sai gowtham

How to update the npm on Windows

In this tutorial, we are going to learn about how to correctly update the npm on the windows operating system using the npm-windows-upgrade package.

Updating the npm

  1. First, open the PowerShell as an administrator and run the following command.
Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force
  1. Install the npm-windows-upgrade package by running the following command.
npm install -g --production npm-windows-upgrade
  1. Now, run the npm-windows-upgrade command.
npm-windows-upgrade

This above command prompt with a list of available versions, select the desired version you want using the arrow keys and hit enter to install it.

If you want to just install the latest version of npm use the below command.

npm-windows-upgrade --npm-version latest

You can also install the specific version of npm like this.

npm-windows-upgrade --npm-version 5.6.0

This above command installs the npm version 5.6.0.

Top Udemy Courses

JavaScript - The Complete Guide 2020 (Beginner + Advanced)
JavaScript - The Complete Guide 2020 (Beginner + Advanced)
45,614 students enrolled
52 hours of video content
View Course
React - The Complete Guide (incl Hooks, React Router, Redux)
React - The Complete Guide (incl Hooks, React Router, Redux)
284,472 students enrolled
40 hours of video content
View Course
Vue - The Complete Guide (w/ Router, Vuex, Composition API)
Vue - The Complete Guide (w/ Router, Vuex, Composition API)
130,921 students enrolled
48.5 hours of video content
View Course