Search code examples
nvm

nvm use does not switch node versions


on a Windows 10 machine and using nvm4w I tried:

from the above image:

  • node --version to check the current version
  • nvm list to list installed versions
  • nvm use 8.8.1 so we switch from 6 to 8
  • nvm on to enable it
  • node --version to re-check the node version

what am I doing wrong?


Solution

  • I had to delete the folder located at C:\Program Files\nodejs:

    enter image description here

    And then run nvm use {version} again to repopulate this folder with the correct node version.

    I suspect that nvm is having trouble deleting this folder due to permission issues.

    I have also experienced an issue where nvm seems to mix up the saved versions of node. For example it will save v14 in place of v16. In this case uninstall the version you wish to use using nvm uninstall {version} and then install it again using nvm install {version}.