coreybutler / nvm-windows

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

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

Closed Uxspy closed 8 years ago

Uxspy commented 9 years ago

nvmw: V1.0.6, windows 8(64bit), normal install, no errors during install, after install, click finish with "run cmd" by default.

image

Uxspy commented 9 years ago

As a workaround, I copy the "settings.txt" from c:\users\my-user\name\appdata\roaming\nvm to c:\ and it works.

mnpenner commented 9 years ago

I had this issue too. Moved settings.txt to C:/ but my install is still broken. Not sure if it's related.

jrgleason commented 9 years ago

No roaming file here this is a clean install what am I supposed to do?

jrgleason commented 9 years ago

looks like just creating the file with nothing in it works is this correct?

reedog117 commented 9 years ago

I'm having the same problem with Windows Server 2012 R2. Completely clean Windows install. Downloaded v1.0.6 and have the same issue. Tried copying settings.txt to c:\ but same problem.

Also, attempting to start nvm from the Start Menu causes a window to flash for a split second and then disappear. This makes me think that there's something wrong with paths..

tohagan commented 9 years ago

Copied settings.txt to c:\ and it worked for me.

reedog117 commented 9 years ago

I finally tried a reboot and it seems it worked. Looks like an environment variable probably needs to be set that doesn't get setup until initial login. I wonder if there's any way to guarantee triggering it right after installation.

mnpenner commented 9 years ago

This happens after a fresh install of Windows 10 too, with no prior node or iojs installations.

vkbansal commented 9 years ago

I believe that the main culprit behind this error is NVM_HOME not being set.

This might be fixed if you close all your command prompts (and I say ALL) and then try again.

mnpenner commented 9 years ago

Yeah, it worked fine for me after I opened a new command prompt and the environment vars were refreshed. I'm not sure if the cmd prompt that pops up at the end of setup opens a little bit too soon? Or does it carry the [lack of] environment vars from the parent process (the installer)? Just a bit annoying that it doesn't appear to install cleanly.

rannday commented 9 years ago

Had the same problem. Added nvm and nodejs (C:\Users\Me\WebDev\nvm - I altered default install directory for nvm - C:\Program Files\nodejs) directories to the PATH, restarted CMD, and it's working now. NVM_HOME and NVM_SYMLINK were set with install, but for whatever reason, it wasn't working. Using Windows 10.

sandhilt commented 8 years ago

nvmw: V1.0.6, windows 10(64bit) no-install; What is workaround if setting.txt no come in pack?

tohagan commented 8 years ago

Here's the contents of my c:\settings.txt file (replace <user> with your user name)

root: C:\Users\<user>\AppData\Roaming\nvm 
path: C:\Program Files\nodejs
vnen commented 8 years ago

Had this issue with v1.1.0 when I opened cmd.exe from the installer. It worked fine after closing the prompt and opening another.

jazzzz commented 8 years ago

Had this with 1.1.0 too, copying %appdata%\nvm\settings.txt to C:\ worked.

Tmarty commented 8 years ago

I also had this issue with v1.1.0 when I opened cmd.exe from the installer. It worked fine after closing the prompt and opening another.

fresheneesz commented 8 years ago

I have this problem on the cmd prompt opened by the installer - this installer: https://github.com/coreybutler/nvm-windows/releases/download/1.1.0/nvm-setup.zip

If I open up a new command prompt, it works fine. Same as eeeeeverybody else.

s100 commented 8 years ago

Seeing the same problem when using the "noinstall" version. If there's a particular environment variable which needs to be set before it'll work, that's fine, but the error message should say what needs setting.

E: Actually, we can go one better. After reading the manual installation instructions it seems that there are much simpler solutions. settings.txt should exist as part of the "noinstall" ZIP; and if the root and path settings are omitted they should default to NVM_HOME and NVM_SYMLINK. Likewise, if NVM_HOME and NVM_SYMLINK are missing, they should default to the location of nvm.exe and a subdirectory of that directory respectively.

coreybutler commented 8 years ago

The prompt to open a terminal window after installation has been removed. It may come back in a future version with a different installer. Bottom line: the installer launches the window prematurely on too many systems, in an unreliable patter.... so it's gone in 1.1.1.

RicardoSouzaMoura commented 6 years ago

Don't forget to do what are explained in the wiki https://github.com/coreybutler/nvm-windows/wiki

toddalbers commented 5 years ago

A suggestion for the nvm installer is maybe give a message to the user at beginning of install that the command window will close once install is complete. Then, just close the command window when the install finishes. Then the user is forced to open a new command window after installation.

qaisjp commented 4 years ago

If you come across this error and use Windows Terminal, try closing Windows Terminal completely and reopening it -- don't just open a new tab.

bernardoadc commented 3 years ago

Here I installed in a different drive, and it only worked in a:\settings.txt. But this is annoying, I wish I could control where this file is (I have a special folder with configs from all apps) or at least in the nvm folder

projeffboy commented 3 years ago

I followed what vkbansal did by setting NVM_HOME to where my nvm is and it worked

zachbugay commented 2 years ago

I ran into this issue as well.

I installed nvm using scoop on the latest powershell version, 7.1.4

My NVM_HOME and NVM_SYMLINK environment variables were not set. I had to manually set them. After I manually set the environment variables it worked without creating a settings.txt file, and without any other issues.

ryegrammer commented 2 years ago

I ran into this problem doing the manual install. Wasted a ton of time trying most of these suggestions. Eventually, I just uninstalled and did the nvm-setup.zip and it ran without issue... another evening learning computer programming, thinking I'll get something done, but just installed NVM and node... Thanks to those of you that can stick with it and make good things.

jones-Blackwell commented 2 years ago

I tried most of the solutions that worked for other people here but still was facing the same issue so I just created a new file and save it as settings.txt inside the folder I extracted the nvm zip.... and manually add this folder to path because the installer.cmd did not work for me even after restart (on windows 10). Opened the new PowerShell (even cmd can work). You can download the settings.txt file on following link settings.txt and modify it according to your pc specs.

kid1412621 commented 2 years ago

for those who install via scoop, dir is: C:\Users\<username>\scoop\persist\nvm

duaneking commented 2 years ago

Just had this issue on a brand new install of Windows 11 on a brand new laptop using the latest bits of everything.

If you encounter this issue, close all terminals, all instances of Windows Terminal, All instances of console, then get coffee/tea/water, then reopen Windows Terminal as Admin and type 'nvm root' and it should work... it did for me.

limbertin commented 2 years ago

settings.txt needs to be copied to the root of drive where nvm is installed, in my case it was G:\Program\nvm, so coping settings.txt to C: didn't work, until I copied to G:\:settings.txt

PStoner3 commented 2 years ago

I just downloaded and used the nvm-setup.exe for version 1.1.9 and had the same issues. While it collected the install and symlink directories, it would seem the installer is not adding the necessary environment variables, %NVM_HOME% and %NVM_SYMLINK%. after following the manual install directions and adding those variables, everything worked perfectly.

There was no need to move the settings.txt file from the root install directory.

basickarl commented 1 year ago

As with everything in Windows: RESTART YOUR MACHINE.

Hrojas1997 commented 1 year ago

Como con todo en Windows: REINICIA TU MÁQUINA.

REINICIANDO LA MAQUINA SE ARREGLA.

Scyntrus commented 1 year ago

So "noinstall" doesn't mean that you don't have to install, it means that it won't install for you and you have to install it yourself. Just use the setup version.

gyohza commented 1 year ago

Just expanding on the comment by vkbansal, which 8 years later still remains helpful:

eric-kelley commented 1 year ago

I have 2 pertinent things to say about this.

1) if you did the manual install from the installation guide you will get this error. Delete the npm folder from your manual install and just run nvm-setup.zip

2) if you are using a company computer you may have to make AppData not hidden

ktmn commented 1 year ago

I ran CMD (not PWS) as administrator and ran mklink "C:\settings.txt" "%APPDATA%\nvm\settings.txt" for the "workaround"

sotoskprs commented 9 months ago

Restarting my PC worked for me

kentshenlim commented 4 months ago

For me I named the file as settings.txt; show the extension then the actual name is settings.txt.txt. Remove the extra extension.

wykopx commented 4 weeks ago

SOLUTION FOR AUTOMATED INSTALLATION

I am installing nvm and all other stuff using winget *.bat script / command line In the script I am setting temp local variable NVM_HOME This works and solves \settings.txt error

winget install --wait --disable-interactivity --location "c:\nvm" -e --id CoreyButler.NVMforWindows
SET NVM_HOME=c:\nvm\
nvm install latest