coreybutler/nvm-windows

[Issue]: Cryptic error message when environment variables are not available

s-h-a-d-o-w opened this issue · 1 comments

What happened?

Immediately after installation using the setup exe:

C:\Users\andy\dev\alfc>nvm ls

ERROR open \settings.txt: The system cannot find the file specified.

C:\Users\andy\dev\alfc>refreshenv
Refreshing environment variables from registry for cmd.exe. Please wait...Finished..

C:\Users\andy\dev\alfc>nvm ls

    22.11.0
    18.20.5

What did you expect to happen?

An error message that lets me know that nvm can't find the required environment variables.
(Additionally, I think it would be good if the installer asked the user to reboot at the end of the installation to avoid this in the first place. Should probably be optional - for power users who want to use refreshenv for the time being.)

Version

1.1.11 or newer (Default)

Which version of Windows?

Windows 11+

Which locale?

English (Default)

Which shell are you running NVM4W in?

Command Prompt

User Permissions?

Standard Use, Non-Elevated

Is Developer Mode enabled?

Yes

Relevant log/console output

No response

Debug Output

Windows Version: 10.0 (Build 22631)

Windows Developer Mode: UNKNOWN (user cannot read registry)

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

Total Node.js Versions: 2
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 use" is run.

IPv6 is enabled. This can slow downloads significantly.

WARNING: The following Node installations are missing npm: v18.20.5
         (Node will still run, but npm will not work on these versions)

PROBLEMS DETECTED
-----------------
"C:\WINDOWS\System32\cmd.exe - nvm  debug" is not an officially supported shell. Some features may not work as expected.        



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

Anything else?

No response

Does this still occur in v1.2.1? I added more error handling/messages and added refreshenv to the prompt that opens upon completion of the install.