Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save kurtmilam/691ebb4b8633a9accf1d47e33dd5204d to your computer and use it in GitHub Desktop.
Save kurtmilam/691ebb4b8633a9accf1d47e33dd5204d to your computer and use it in GitHub Desktop.
how to upgrade npm and uninstall a specific node version when using windows-nvm

Do these from powershell or bash running as admin.

Upgrade npm

Node usually ships with an older version of npm.

Two things to consider:

  1. You'll need to upgrade npm once for each version of node installed by nvm-windows with which you wish to use the different version of npm.
  2. You'll need to manually specify the nvm-windows' installation path for the version of node whose associated npm you wish to upgrade.

First, install npm-windows-upgrade. Then, locate the nvm-windows installation path for the version of node whose npm you wish to upgrade. Usually at C:\Users\[user name]\AppData\Roaming\nvm\[node version].

Now, determine the version of npm you want to use.

Final step: run npm-windows-upgrade --npm-version [npm version] --npm-path "[path/to/node version]"

For error "Error removing node [version]" when trying nvm uninstall [version]

Looks like this:

nvm uninstall 6.10.3
Uninstalling node v6.10.3...Error removing node v6.10.3
Manually remove [nvm path]/v6.10.3.

Navigate to [nvm path]\v6.10.3, rename node.exe to node64.exe, then execute nvm uninstall 6.10.3 from the command line again.

This appears to be due to a bug that the author of nvm-windows plans to fix. In the meantime, the preceding process works fine for me on a Windows 10, 64 bit.

@waleedtariq109
Copy link

I rename node.exe into node64.exe but still, the same error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment