Search code examples
node.jsnvm

Why is nvm use not being persisted


nvm I'm using Windows 10 (with PowerShell 7) and have NVM for Windows (1.1.12).

For some reason when I do nvm use 21.7.3 to switch to the latest version of node, this change is not persisted. If I immediately follow with nvm current it shows the older version.

PS C:\Windows\System32> nvm list

  21.7.3
  12.22.12
* 10.16.3 (Currently using 64-bit executable)
PS C:\Windows\System32> nvm current
v10.16.3
PS C:\Windows\System32> nvm use 21.7.3
Now using node v21.7.3 (64-bit)
PS C:\Windows\System32> nvm current
v10.16.3
PS C:\Windows\System32> nvm use 21.7.3
Now using node v21.7.3 (64-bit)
PS C:\Windows\System32> node --version
v10.16.3

What is causing this change to not be persisted and how can I fix it?

I believe I installed the 10.16.3 via the installer, as I can see it under C:\Program Files\nodejs could this be the issue?


Solution

  • I couldn't reproduce it, but I guess it's easier to uninstall the version(s) listed in "Add or Remove Programs" and reinstall using nvm install ... than to figure out the actual cause of the issue.