Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"nvm could not be found" when user name has umlaut or non-ascii character #726

Open
heneds opened this issue Jan 14, 2022 · 28 comments
Open

Comments

@heneds
Copy link

heneds commented Jan 14, 2022

Issue:
After a fresh installation of nvm the application does not work but fails with the error message
"C:\Users_USERNAME_\AppData\Roaming\nvm could not be found or does not exist. Exiting."
This happens when USERNAME contains a non-ascii character. In the error message these characters are replaced with �.

How To Reproduce:

  1. Create or use an Windows account with umlauts or non-ascii characters in the user name (and more importantly in the name of the user folder)
  2. Install nvm.
  3. If the installer asks to handle an existing node installation, answer yes
  4. Run "nvm list"

Expected Behavior:
Expecting to see a list of node versions.

Workaround:
It works properly if you correct the path in settings.txt (while keeping the UTF-8 encoding)

Desktop:
Windows 11

@heneds
Copy link
Author

heneds commented Jan 14, 2022

Regarding the workaround: it's the "root" setting that needs correcting.

@coreybutler
Copy link
Owner

Which version of NVM4W are you using? There appears to be an issue in older versions of Go that misinterpret umlauts and other western European characters. I'm unclear whether these issues are fully resolved in more recent versions of Go.

@heneds
Copy link
Author

heneds commented Jan 19, 2022

I was using the latest version 1.1.9.

@heneds
Copy link
Author

heneds commented Jan 19, 2022

I can't find the installer version but it was created on December 15 at ‏‎20:11:50.

@coreybutler
Copy link
Owner

Thanks, v1.1.9 was created with Go 1.17, which is the latest stable release of Go. I'm unsure how to troubleshoot this at the moment since I do not have access to a German version of Windows. There is also a possibility this hasn't been fixed (or a reversion happened). I will look into this to the best of my ability, but I wouldn't count on an immediate resolution given the circumstance.

@JakeRG
Copy link

JakeRG commented Feb 4, 2022

+1 from me - same issue seems to have occurred with a colleague with a Ç in his last name trying to install v1.1.9. We have not attempted older versions.

The version of Windows does not seem to be the issue (I believe he too is running on an English install) - it seems to be merely the path to the install location, in this case the username part. If I understand correctly, this should be reproducable by creating a new user (either "online" / MS account, or offline) with one or more "special" characters like those mentioned in the username. But I could be mistaken =)

@github-actions
Copy link

github-actions bot commented Mar 7, 2022

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale Stale label Mar 7, 2022
@heneds
Copy link
Author

heneds commented Mar 7, 2022

Not stale AFAIK. (Looks like #744 is a recent duplicate.)

@github-actions github-actions bot removed the Stale Stale label Mar 8, 2022
@karl-sjogren
Copy link

I didn't have this problem until after I upgraded to Windows 11 and upgraded NVM. It worked fine before upgrading to 1.1.9 but downgrading now doesn't help.

I got around this by opening C:\Users\Karl-JohanSjögren\AppData\Roaming\nvm\settings.txt and resaving the file as UTF8, so I'm guessing that it could have something to do with how the installer writes this file on Windows 11?

@coreybutler
Copy link
Owner

@karl-sjogren thanks for sharing. It could be the installer, but it could also be Windows 11 not respecting the file encoding (which should be UTF8 by default). It's a little difficult to tell while Windows 11 keeps receiving updates.

It sounds like encoding is the problem regardless of whether the content is read from the settings file or displayed as an error message.

Go 1.18 was just released and it looks like there may be a fix. I'll try building the next maintenance release on this to see if it resolves @heneds original issue. As for the installer, it hasn't changed in years (and works on American English editions), so I suspect something is going on with the Windows 11 encoding. Regardless, I will look into this when I get a chance to build the next update.

@coreybutler coreybutler pinned this issue Apr 5, 2022
@github-actions
Copy link

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale Stale label Apr 18, 2022
@github-actions
Copy link

This issue was closed because it has been stalled for 7 days with no activity.

@eugeniomiro
Copy link

Having this same issue on Windows 11 and NVM 1.1.9 installed from Winget

@coreybutler coreybutler reopened this Jun 19, 2022
@coreybutler
Copy link
Owner

This wasn't supposed to be closed by the bot.

@github-actions github-actions bot removed the Stale Stale label Jun 20, 2022
@noysom
Copy link

noysom commented Jun 20, 2022

@karl-sjogren thanks for sharing. It could be the installer, but it could also be Windows 11 not respecting the file encoding (which should be UTF8 by default). It's a little difficult to tell while Windows 11 keeps receiving updates.

It sounds like encoding is the problem regardless of whether the content is read from the settings file or displayed as an error message.

Go 1.18 was just released and it looks like there may be a fix. I'll try building the next maintenance release on this to see if it resolves @heneds original issue. As for the installer, it hasn't changed in years (and works on American English editions), so I suspect something is going on with the Windows 11 encoding. Regardless, I will look into this when I get a chance to build the next update.

I just experienced this on a newly installed nvm v1.1.9, Windows 10 pro (10.0.19044). Opened nvm\settings.txt and it was saved as ANSI encoding. Converting it to UTF8 as suggested by Karl fixed the issue.

Just wanted to give a second report of this as it happened on Windows 10 too.

@senthamizh-selvan-sf3819

Can't we add the chcp 65001 > nul line to the nvm-windows/bin/install.cmd line 21 for saving files in UTF-8 format? If this isn't useful, please accept my apologies for wasting your time.

https://stackoverflow.com/questions/16598785/save-text-file-in-utf-8-encoding-using-cmd-exe

@JakeRG
Copy link

JakeRG commented Jun 29, 2022

I only realized after @noysom 's message that I never mentioned that, afaik, my colleague who has this issue is also running on Windows 10 instead of 11.

We eventually worked around it by installing NVM in a different location (read; not the user directory, and thus avoiding having the non-ascii character in his username in the install path), as mentioned before.

[edit:] ... by 'before' I meant I could swear it was mentioned by someone else in this thread as a workaround. It seems I was mistaken as I can't find it. It was probably in one of the duplicate issue threads instead. So if anyone wanted to know another workaround that the "change encoding" one mentioned in here, there you go, just know I don't deserve the credit for it ;) [/edit]

@Snailedlt
Copy link

Snailedlt commented Jul 18, 2022

Same issue on Windows 10 Pro with a non-ascii username (Jørgen)
image

image

PS C:\Users\Jørgen> nvm install lts
C:\Users\J�rgen\AppData\Roaming\nvm could not be found or does not exist. Exiting.
Downloading node.js version 16.16.0 (64-bit)...
Error while creating C:\Users\J�rgen\AppData\Roaming\nvm\v16.16.0\node.zip - open C:\Users\J�rgen\AppData\Roaming\nvm\v16.16.0\node.zip: The system cannot find the path specified.
Could not download node.js v16.16.0 64-bit executable.
PS C:\Users\Jørgen> nvm list
C:\Users\J�rgen\AppData\Roaming\nvm could not be found or does not exist. Exiting.

No installations recognized.

EDIT:

Found a workaround

Change the install folder to a filepath without non-ascii letters in it. I installed it to D:/nvm

EDIT 2:

I recommend changing your windows username to ASCII-only letters

Because this is a common issue with a lot of other apps as well, I opted to change my windows profile name instead. I recommend this for anyone who's reasonably tech-savvy, understand the risk and are willing to spend some time (1-2hrs) changing the username to save you from a lot of trouble down the line.

DISCLAIMER!
Note that changing your username is not recommended by Microsoft, as it can mess up your operating system if you're not careful.

That said, here's some resources I used:

@DennisRosen
Copy link

Just ran into this as well and had to change the installation directory.

@github-actions
Copy link

github-actions bot commented Sep 1, 2022

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale Stale label Sep 1, 2022
@github-actions
Copy link

github-actions bot commented Sep 9, 2022

This issue was closed because it has been stalled for 7 days with no activity.

@github-actions github-actions bot closed this as completed Sep 9, 2022
@coreybutler coreybutler removed the Stale Stale label Nov 23, 2022
@coreybutler
Copy link
Owner

Bot keeps closing this.

@1898182
Copy link

1898182 commented Dec 1, 2022

Also happens with nvm v1.1.10 and Windows set to English. User name contains é character.

@github-actions github-actions bot added the Stale Stale label Jan 1, 2023
@coreybutler coreybutler removed the Stale Stale label Jan 1, 2023
Repository owner deleted a comment from github-actions bot Jan 1, 2023
@github-actions github-actions bot added the Stale Stale label Feb 1, 2023
Repository owner deleted a comment from github-actions bot Feb 1, 2023
@coreybutler coreybutler removed the Stale Stale label Feb 1, 2023
@LoboMetalurgico
Copy link

LoboMetalurgico commented Mar 1, 2023

This issue also happens if the directory contains a space, however the workaround does not work.

@GuillaumeNo
Copy link

It has also happened to me on Windows 11 Pro, my username contains a ë character. The workaround has worked.

Adding it to the Documentation would be nice. I can do it if you want

@tscislo
Copy link

tscislo commented Nov 11, 2023

Same for me Windows 11 with Polish non ascii signs workaround with changing settings.txt to urf-8 encoding helped #726 (comment)

@snerte
Copy link

snerte commented Dec 6, 2023

I didn't have this problem until after I upgraded to Windows 11 and upgraded NVM. It worked fine before upgrading to 1.1.9 but downgrading now doesn't help.

I got around this by opening C:\Users\Karl-JohanSjögren\AppData\Roaming\nvm\settings.txt and resaving the file as UTF8, so I'm guessing that it could have something to do with how the installer writes this file on Windows 11?

Happened to me today. This workaround fixed it.

➜ nvm -v
1.1.11

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

No branches or pull requests

15 participants