nvm-windows: After install every command fails with message "C:\Users\%username%\AppData\Roaming\nvm could not be found or does not exist. Exiting."

If %username% in path C:\Users\%username%\AppData\Roaming\nvm contains some non-latin symbols (in my case username is written with cyrillic characters), every nvm command displays this error message, for example:

C:\Windows\system32>nvm arch
C:\Users\�����\AppData\Roaming\nvm could not be found or does not exist. Exiting.
System Default: 64-bit.
Currently Configured: 64-bit.

Possible solution is to write settings.txt with encoding UTF-8 instead of ANSI. After manual correction of file encoding with Notepad++ error message disappears and now everything works fine:

C:\Windows\system32>nvm arch
System Default: 64-bit.
Currently Configured: 64-bit.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 16
  • Comments: 20 (2 by maintainers)

Most upvoted comments

If anyone is suffering from this, here’s a suggestion:

  • type “nvm root” to know where is the nvm current path
  • In windows explorer, copy the contents of the previous path to a simpler path like “c:\nvm”.
  • In system variables, search for NVM_HOME and update its value to the new path.
  • Then type “nvm root [new path]” (like “nvm root c:\nvm”). (don’t forget to close cmd, and open a new one.)

Everything should work without problems.

On a side note, I would like to help, but I don’t know Go, so…

This https://github.com/coreybutler/nvm-windows/issues/334 was very useful to me, where does it say to run on terminal nvm root C:\Users\username\AppData\Roaming\nvm

this fails: C:\Users\Lucian Naie\AppData\Roaming\nvm

This #334 was very useful to me, where does it say to run on terminal nvm root C:\Users\username\AppData\Roaming\nvm

Thanks! It works!

I also have a space in my Windows User folder, and @urbgimtam’s work around worked for me.

@lnaie I think there is another issue regarding spaces or whitespace in the user name, please add your voice there. @janjon Do your NVM_* environment variables have the correct values in them if you do a gci env: in a PowerShell window?