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

[Issue]: Doesn't function correctly when settings.txt isn't ascii format #1124

Open
iancward opened this issue Apr 11, 2024 · 2 comments
Open
Labels
consider for rt Pinned for use in the rt project investigating planned

Comments

@iancward
Copy link

What happened?

We did the "noinstall" deployment method and generated settings.txt with PowerShell. Apparently this caused the file to be generated with UTF-16LE, which is the default encoding by PowerShell.

Running nvm list causes this issue:

nvm list
 could not be found or does not exist. Exiting.

No installations recognized.

We had to convert settings.txt to ascii because even as UTF-8, it didn't work.

What did you expect to happen?

I expected that NVM should work. Although I understand that UTF-16LE isn't exactly a common (outside of PowerShell) encoding scheme.

Version

1.1.11 or newer (Default)

Which version of Windows?

Windows 10 (Default)

Which locale?

English (Default)

Which shell are you running NVM4W in?

PowerShell

User Permissions?

Administrative Privileges, Elevated

Is Developer Mode enabled?

None

Relevant log/console output

nvm list
 could not be found or does not exist. Exiting.

No installations recognized.


### Debug Output

```Shell
PS C:\Windows\system32> nvm debug
 could not be found or does not exist. Exiting.
Running NVM for Windows with administrator privileges.

Administrator:
Windows Version: 10.0 (Build 17763)

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

Total Node.js Versions: 0
Active Node.js Version: none
(run "nvm use <version>" to activate a version)
NVM_SYMLINK does not exist yet. This is auto-created when "nvm us
e" is run.

IPv6 is enabled. This can slow downloads significantly.

PROBLEMS DETECTED
-----------------
"Administrator:  " is not an officially supported shell. Some fea
tures may not work as expected.



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


### Anything else?

There are few possible related issues:

https://github.com/coreybutler/nvm-windows/issues/1107
https://github.com/coreybutler/nvm-windows/issues/1104
https://github.com/coreybutler/nvm-windows/issues/931
https://github.com/coreybutler/nvm-windows/issues/887
https://github.com/coreybutler/nvm-windows/issues/726

And a possibly related PR: https://github.com/coreybutler/nvm-windows/pull/1109
@coreybutler
Copy link
Owner

This is a "known issue", though your success with ASCII is a useful tidbit. UTF-8 was failing too. Normally I'd mark this as a duplicate, but I think this is an important point, so I'll keep this open until I can figure out a fix. There are some challenges with ASCII I'll need to think through.

@coreybutler coreybutler added investigating consider for rt Pinned for use in the rt project planned labels Apr 11, 2024
@iancward
Copy link
Author

In PowerShell, the > operator effectively maps to Out-File, so to work around this, we switched to | Out-File -Encoding ascii.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
consider for rt Pinned for use in the rt project investigating planned
Projects
None yet
Development

No branches or pull requests

2 participants