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.
- First, open the PowerShell as an administrator and run the following command.
Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force
- Install the
npm-windows-upgradepackage by running the following command.
npm install -g --production npm-windows-upgrade
- Now, run the
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