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

Issue: After installing nvm (from WinGet in this case) and before restarting the terminal, attempting to use nvm will fail.

Now, you might think that restarting the terminal is a simple action the user can do but when you are trying to automate the installation of a bunch of apps and developer tools, it’s not a viable solution to restart the terminal.

Running nvm at this point will fail with the expected error:

nvm: The term 'nvm' is not recognised as the name of...

So the next step would be to invoke nvm directly, which fails with this error:

PS C:\Users\User> C:\Users\User\AppData\Roaming\nvm\nvm.exe install latest

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

How To Reproduce:

  1. Use WinGet to install nvm winget install --id=CoreyButler.NVMforWindows -e
  2. Attempt to run nvm directly as the terminal session will not have the updated %PATH%
  3. Get weird error about missing settings.txt

Expected Behaviour:

It should be possible to automate the installation of developer tooling including nvm without needing to restart the terminal and thus no longer be possible to automate.

Screenshots: image

Desktop:

  • OS: Windows 11 - not tried on Windows 10, probably the same.

Additional context:

If this is some hard to fix error, could it be possible to add an argument to nvm which accepts a path of the settings file to use?

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 24 (7 by maintainers)

Commits related to this issue

Most upvoted comments

Is this a serious reply or some AI generated reply? Please read original issue comment to understand this problem, it’s context, and usage with automation scripts and tools like winget.

This error is because your current command line prompt does not have %NVM_HOME%, just close your command prompt and open it again and it should work.