coreybutler / nvm-windows

A node.js version management utility for Windows. Ironically written in Go.
MIT License
37.28k stars 3.32k forks source link

[Issue]: Invalid settings generation on install when user name contains non-ASCII characters #1107

Closed renepanke closed 3 months ago

renepanke commented 7 months ago

What happened?

After a fresh install the generated path for Node Installations in the settings.txt contains an invalid character sign ( ) for non-ASCII characters and therefore the path can't be found.

Node Installations: C:\Users\Ren�\AppData\Roaming\nvm

What did you expect to happen?

The settings.txt is generated with a valid path. If that is not feasable an entry in the common issues and resolutions should be added that you need to manually update the path in the settings.txt.

In the Relevant log/console output window you can see the nvm debug output before and after adjusting the path in the settings.txt.

Version

1.1.11 or newer (Default)

Which version of Windows?

Windows 10 (Default)

Which locale?

Western European

Which shell are you running NVM4W in?

PowerShell

User Permissions?

Administrative Privileges, Elevated

Is Developer Mode enabled?

No (Default)

Relevant log/console output

PS C:\Users\René> nvm install latest
C:\Users\Ren�\AppData\Roaming\nvm could not be found or does not exist. Exiting.
21.6.2
Downloading node.js version 21.6.2 (64-bit)...
Could not download node.js v21.6.2 64-bit executable.
PS C:\Users\René> nvm debug
C:\Users\Ren�\AppData\Roaming\nvm could not be found or does not exist. Exiting.
Running NVM for Windows with administrator privileges.

Administrator: Windows PowerShell
Windows Version: 10.0 (Build 19045)

NVM4W Version:      1.1.12
NVM4W Path:         C:\Users\René\AppData\Roaming\nvm\nvm.exe
NVM_HOME:           C:\Users\René\AppData\Roaming\nvm
Node Installations: C:\Users\Ren�\AppData\Roaming\nvm

Total Node.js Versions: 0
Active Node.js Version: v20.3.1

IPv6 is enabled. This can slow downloads significantly.

PROBLEMS DETECTED
-----------------
NVM_SYMLINK (C:\Program Files\nodejs) is not a valid symlink.

Find help at https://github.com/coreybutler/nvm-windows/wiki/Common-Issues
PS C:\Users\René> nvm debug
Running NVM for Windows with administrator privileges.

Administrator: Windows PowerShell
Windows Version: 10.0 (Build 19045)

NVM4W Version:      1.1.12
NVM4W Path:         C:\Users\René\AppData\Roaming\nvm\nvm.exe
NVM4W Settings:     C:\Users\René\AppData\Roaming\nvm\settings.txt
NVM_HOME:           C:\Users\René\AppData\Roaming\nvm
NVM_SYMLINK:        C:\Program Files\nodejs
Node Installations: C:\Users\René\AppData\Roaming\nvm

Total Node.js Versions: 0
Active Node.js Version: v20.3.1

IPv6 is enabled. This can slow downloads significantly.

PROBLEMS DETECTED
-----------------
NVM_SYMLINK (C:\Program Files\nodejs) is not a valid symlink.

Find help at https://github.com/coreybutler/nvm-windows/wiki/Common-Issues
PS C:\Users\René> nvm install latest
21.6.2
Downloading node.js version 21.6.2 (64-bit)...
Extracting node and npm...
Complete
npm v10.2.4 installed successfully.

Installation complete. If you want to use this version, type

nvm use 21.6.2

Debug Output

PS C:\Users\René> nvm debug
C:\Users\Ren�\AppData\Roaming\nvm could not be found or does not exist. Exiting.
Running NVM for Windows with administrator privileges.

Administrator: Windows PowerShell
Windows Version: 10.0 (Build 19045)

NVM4W Version:      1.1.12
NVM4W Path:         C:\Users\René\AppData\Roaming\nvm\nvm.exe
NVM_HOME:           C:\Users\René\AppData\Roaming\nvm
Node Installations: C:\Users\Ren�\AppData\Roaming\nvm

Total Node.js Versions: 0
Active Node.js Version: v20.3.1

IPv6 is enabled. This can slow downloads significantly.

PROBLEMS DETECTED
-----------------
NVM_SYMLINK (C:\Program Files\nodejs) is not a valid symlink.

Find help at https://github.com/coreybutler/nvm-windows/wiki/Common-Issues

Anything else?

No response

github-actions[bot] commented 6 months ago

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.

renepanke commented 6 months ago

Comment to not let this issue become stale...

iancward commented 5 months ago

We did the noinstall method for NVM and wrote out the settings.txt file with PowerShell, which caused the file to be generated in the (PowerShell default) UTF-16LE encoding, which caused an issue just like this.

Converting the settings.txt to ascii fixed it. It didn't work even with regular UTF-8.

magynhard commented 4 months ago

Same Problem here: image

Opening settings.txt and converting it to UTF-8 using Notepad++ solved it.

image

iancward commented 4 months ago

That's interesting you got it to work using UTF-8; for me, I could only get it to work if the file was ASCII https://github.com/coreybutler/nvm-windows/issues/1124

magynhard commented 4 months ago

I was running on Windows 11 with German locale on the latest nvm 1.1.12 on node 18.12.1

Using the classic command line (cmd).

Notepad++ recognized the settings.txt as ASCII format, so i chose "convert to UTF-8" and it worked.

github-actions[bot] commented 3 months ago

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[bot] commented 3 months ago

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