Upgrade NPM in Windows
There are mainly two ways to upgrade NPM. Also, these upgrade methods are thoroughly recommended by NPM team. You don’t need to worry about whether it’s the right way or not. So, let’s learn the first and easy way.
1. Install the latest MSI
Well, the easiest way to upgrade NPM is to download Nodejs MSI file from its website and install it over your old NPM version. It will automatically upgrade if you install the latest version. Also, there is no down-side to it. It will work just fine.
2. Using the Package for Upgrading
The NPM team has the recommended to use this package on Windows for Upgrading the NPM. It’s pretty simple and easy to use. Also, you don’t need to install or download anything after this. Just install this package globally and run it once a white to keep your NPM up-to-date.
Below are the instructions to upgrade NPM on Windows.
- Run Powershell as Administrator
- Run this command Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force
- Next, run this npm install -g npm-windows-upgrade
- Now, run this npm-windows-upgrade
The last command will upgrade your NPM. After this, when you want to update your npm, just run npm-windows-upgrade. It will update NPM to the latest version.
I hope it has been informative for you. If you have any questions or suggestions, feel free to comment below. Also, you can join our forum and ask your questions frequently there.