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

ERROR open \settings.txt: #22

Closed
megant opened this issue Nov 21, 2014 · 65 comments
Closed

ERROR open \settings.txt: #22

megant opened this issue Nov 21, 2014 · 65 comments

Comments

@megant
Copy link

megant commented Nov 21, 2014

After installation process I just ran "npm" and it says:

ERROR open \settings.txt: [...]

@coreybutler
Copy link
Owner

Does the settings file exist in your installation directory?

@megant
Copy link
Author

megant commented Nov 21, 2014

Does the installation directory mean the folder where the installed application is or where the installer is?

@coreybutler
Copy link
Owner

Where the installed application goes... the default for this is C:\Users\<yourusername>\AppData\Roaming\nvm. It should look something like this:

image

The main files to look for are elevate.cmd, elevate.vbs, nvm.exe, and settings.txt, as well as nodejs.ico (which is just the icon, it doesn't provide any functionality).

If settings.txt does not exist, then it probably wasn't created during the installation process. The installer should do this for you, but the manual install does not. If you used the installer and do not see the settings.txt file, then there is probably a bug in the installer that I'd be interested in tracking down and fixing.

The settings file should contain content similar to:

root: C:\Users\Corey\AppData\Roaming\nvm
path: C:\Program Files\nodejs

@bobbycircle
Copy link

Hi, this happened to me, too. After the installer finished it opened cmd.exe, and cmd.exe opened with that error message.

settings.txt does in fact exist in my installation folder.

When I examine my new path variable, it has this at the end: " [...my previous paths...];%NVM_HOME%;%NVM_SYMLINK% "

So it seems like, possibly those %variables% are not getting evaluated into actual dirs before appending them to the search path during the installer? When I manually add the right dirs to my path, it appears to work, although I'm new to node.js so I have very little idea what I'm talking about yet.

@coreybutler
Copy link
Owner

@bobbycircle - It is possible the variables aren't being evaluated at the right time... I'll have to look into that. I didn't think about that before because... well it has been working and I haven't changed that part of the installer. I'll look into this as soon as I can.

@noizyboy
Copy link

Same thing here. As per @bobbycircle, manually tweaking my PATH variable sorted it out.

@dan-sterling
Copy link

I encountered the same error after installation. On Windows 8+, you need to create a new cmd window to see the evaluated %nvm_home% and %nvm_symlink% environment variables. This is a change from Win 7 to 8 where an existing windows explorer shell can not create a new process and see the new environment variables. If you are starting cmd.exe from Explorer, you need to first close Win Explorer and restart it to see new Env variables.

@coreybutler
Copy link
Owner

@dan-sterling - I have not encountered this with Windows 8 (which is what I developed this on). This is specifically why the user attributes are set as well, then the cmd shell will pickup on the path. It shouldn't matter though - I'm building an entirely new installer to resolve these issues.

@okonomiyaki3000
Copy link

Got the same problem. What's more, creating settings.txt in that directory didn't fix it. I needed to create it at ~

@queckezz
Copy link

I had the same Issue. #23 @colmsjo's comment resolved it for me.

Simply remove %NVM_HOME% and NVM_SYMLINK from the user environment variables.

@abcfy2
Copy link

abcfy2 commented Dec 28, 2014

Same issue here. I followed @queckezz's solution, it works.

@gmarziou
Copy link

gmarziou commented Jan 9, 2015

I have also this issue everytime I install it, I think that launching cmd.exe at the end of installation is not a good idea as it may fail too often giving a bad first impression of the tool.

I would rather not launch cmd.exe and ask the user to close his Windows session, open a new one and then try nvm in a command prompt window.

@jimbriam
Copy link

Also, ran into this problem, when running the 1.0.6 installer. Windows 8, Ran the installer as Admin. file.exe was not in my path. Install of GnuWin32 also did not solve the problem. Node had not been installed yet.

@kaibadash
Copy link

I could use to copy settings.txt to c:\ .

@tomyam1
Copy link

tomyam1 commented Jan 27, 2015

@bobbycircle solution worked for me.

@Schurke
Copy link

Schurke commented Mar 7, 2015

I encountered this issue also (windows 8.1). Closing and restarting the command prompt didn't help (process may still have been running - didn't check). On a hunch, I restarted windows. Problem resolved: no mucking around with the installer PATH vars. Give it a shot before changing anything
@coreybutler - may also be a good failsafe for the installer: trigger a restart at the end "for your changes to take effect" to eliminate some of the user environment variances.

@romualdr
Copy link
Contributor

Sometimes, when tweaking environnement variables, this can happen 👍

  • You didn't push "OK" button on the "Edit environnement variable" window
    Yup. This might look dumb, but i actually spent a lot of time, changing vars and restarting PowerShell, and nothing was happening ... until i closed this window ! Clicking the "OK" button is VERY important, if you close the window or cancel, your modifications will be discarded. Then just reload your term.
  • You term can be faulty, try another one.
    If you are using Github for Windows and Git, you might end up with 3 terms (PowerShell, Git Shell, Git Bash). Each term can have his own environnement, and tweaking values will not solve anything. Try PowerShell or cmd.exe (vanilla windows terms) before.

@bartread
Copy link

Just ran into this on Windows 8 as well.

@zyonet
Copy link
Contributor

zyonet commented Apr 15, 2015

run your cmd terminal as adminstrator

@PureKrome
Copy link

Is it possible that this failed because the install failed .. because of a space in the User folder? This occurs in bug/issue #41 so maybe that's happening here, too?

@vineelp
Copy link

vineelp commented Apr 26, 2015

@queckezz solution worked

@matthieu-rolland
Copy link

@queckezz solution worked. thank u

@PyroSA
Copy link

PyroSA commented Jul 1, 2015

I had this issue.

The installer ran with elevated privileges (required for installation).
The cmd session it launched then also runs with elevated privileges, but refused to see the settings .txt

Relaunching a non-admin cmd saw settings.txt just fine, and nvm now also runs fine in a admin session launched as an admin.

@arizonatribe
Copy link

@queckezz solution also worked for me. Thanks

@wch4896
Copy link

wch4896 commented Jul 8, 2015

@queckezz solution worked +1

@giggio
Copy link

giggio commented Jul 10, 2015

I had the same problem. The issue was that "C:\Program Files\nodejs" was in my user path, right before the new vars ;%NVM_HOME%;%NVM_SYMLINK%.

@sanori
Copy link

sanori commented Aug 21, 2015

In my case (Windows 7 and Windows 8.1), this phenomenon occurs just after the installation.
If I reboot after installation, nvm for windows works normally

@olegkalyta
Copy link

@mcpDESIGNS thank you, it helped me too!

@AdrianoCahete
Copy link

I have the same problem in Win10 x64.
But in my case is because the symbolic link pointed to a unexisting folder in C (C:\Program Files\nodejs\v1.1.2).
The only folder in nodejs folder is "v4.0.0", so i needed to remove symlink and create another using mklink /j "C:\Program Files\nodejs" "G:\Program Files (x86)\nvm

@ackvf
Copy link

ackvf commented Jan 2, 2016

This is still an issue on Windows 7 as of 2.1.2016. The variables are not being evaluated in a child cmd.

Solution is to open a fresh cmd window.

@coreybutler I suppose you are using SETX VAR value and start cmd.

SETX VAR value sets environmental variable named VAR for fresh instances of cmd only
start cmd starts a children of current cmd that uses parent's environment

A workaround is to supplement the SETX with SET VAR=value to duplicate the value to current environment for child processes.

@li-tkiefer
Copy link

I tried many of the above solutions, and the only one that ended up working for me was to restart Windows 7. 😞

@coreybutler
Copy link
Owner

FYI: Windows 7 support = deprecated.

@coreybutler
Copy link
Owner

@vferko - I'm not explicitly using SET or SETX. The InnoSetup engine handles all of this. I believe the problem is in sequencing. Sporadically, the installer appears to be launching the cmd window before the environment variable setup methods are complete.

@dcorto
Copy link

dcorto commented Apr 5, 2016

FYI: The ERROR open \settings.txt: [...] happened to me on a Win10 x64. After open a new cmd window seems there is all ok :)

@SleeplessByte
Copy link

Still happens with the 1.1.0 in Win10 x64. Same as @dcorto

restart cmd.exe and you're good

@kukuruznik
Copy link

I've got somehow different symptoms, but it seems to be related to this issue:

  • Win7 64bit, installation successful, but 'nvm' is not recognized as an internal or external ...
  • After every system restart, nvm can be run from the command line, until the first nvm use - then again 'nvm' is not recognized ...
  • Deleting the User variables NVM_HOME and NVM_SYMLINK solved the issue (%vars% replaced in PATH with their values)

@coreybutler
Copy link
Owner

This should be resolved with the new installer. InnoSetup was upgraded for v1.1.7 and several new changes were made to install.cmd. Windows 7 is also not technically supported, by NVM4W or Microsoft.

@mandaputtra
Copy link

I got same error with the new 1.1.7 where is the user variable i dont see it on settings.txt

@mandaputtra
Copy link

Sorry just restart the computer and its work 💯

@TomasHubelbauer
Copy link
Contributor

This error is still present. I was using NVM without an issue for a while and now I've had a project which required me to move my NPM cache directly to the C drive (to avoid long path issues) and after I've made this change (probably, that's the only NPM configuration change that I did and the same day this started happening…) this issue started happening.

I found that running Powershell as an admin allow me to run NVM with no issues, which is a workaround I'll be using for now (I might set the settings.txt file permissions to "anything goes" like the other poster if it gets too annoying).

@toddalbers
Copy link

toddalbers commented Sep 3, 2019

I don't think this will be a fix for all. But maybe for some. SHORT ANSWER: Try closing the command window and opening a new command window. LONG ANSWER: I found that if I installed nvm using the nvm_setup.exe (downloaded in nvm_setup.zip) from the windows command line (cmd.exe command window) and then tried to run nvm in the same command window session (right after installing), it gave me this error - ERROR open \settings.txt. I looked and the paths were added to my system PATH settings fine. So, I closed the command line window and opened up a new command window. It then worked. I think even though the install adds the path to nvm.exe (and to settings.txt) to the Windows PATH, it isn't recognized in that same command window yet. Close the command window and open a new one. Hope this helps someone. A suggestion for the installer is maybe give a message to 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.

@Fadeoc
Copy link

Fadeoc commented Sep 13, 2019

Still happens with the 1.1.0 in Win10 x64. Same as @dcorto

restart cmd.exe and you're good

same with win10 + powershell, just close instance of cmd or powershell and restart a new cmd or powershell

@coreybutler
Copy link
Owner

InnoSetup doesn't always respect the order of operations when writing the initial settings file and setting the path. This is why reopening the window works after initial install.

@Muizuddeen
Copy link

I got error when i ran npx create react app it says enter the exact path where the zip file is extracted/copied: it's having after nvm installation and installation of node 12.

@SleeplessByte
Copy link

Still happens with the 1.1.0 in Win10 x64. Same as dcorto

restart cmd.exe and you're good

This stil works (as workaround) @Muizuddeen

@AdrianoCahete
Copy link

Found that if you copy the settings.txt to c: works too

@emallove
Copy link

I hit this issue on v1.1.9.

@DigDugIA
Copy link

DigDugIA commented Feb 13, 2023

Greetings. Thanks for all your time supporting NVM.

I just downloaded and ran the install EXE for NVM 1.1.10. I do the nvm -v and get that version number back. I do nvm by itself and get the help info. When I try the "nvm install latest" command I get this back.

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

I can see all the files listed at the top of this Issue.

Directory Image:
image

Not sure what to do next. Need to get NPM installed, so I can run a OpenAPI generator to get a C# API library for a company I need to do API calls into.

Thanks.

@chill389cc
Copy link

chill389cc commented Aug 1, 2023

I get this error sporadically on windows, which is annoying. I know that there are no issues with my path because I can enter settings.txt in a shell and it opens up the nvm settings. I'm not sure why nvm can't open it sometimes if my shell has no issues.
Currently it works if I open up a WSL prompt but that is it.

@jimtut
Copy link

jimtut commented Aug 29, 2023

Just got this with 1.1.11 today. The error is very specific that "\settings.txt" doesn't work. You need to put the file at the root of the hard-drive. Not sure why, but even when running from c:\nvm, it couldn't read the settings.txt from there, needed to be at c:\settings.txt.

@JackAllread
Copy link

Above it was stated that the settings.txt file's content was:

root: C:\Users\Corey\AppData\Roaming\nvm
path: C:\Program Files\nodejs

But, I found that it's the other way around:

path: C:\Users\Corey\AppData\Roaming\nvm
root: C:\Program Files\nodejs

And with the security on my dev computer as tight as it was I had to place the nvm folder in
path: C:\Users\Public\Roaming\nvm

Which worked fine.

@rushian
Copy link

rushian commented Sep 22, 2023

Where the installed application goes... the default for this is C:\Users\<yourusername>\AppData\Roaming\nvm. It should look something like this:

image

The main files to look for are elevate.cmd, elevate.vbs, nvm.exe, and settings.txt, as well as nodejs.ico (which is just the icon, it doesn't provide any functionality).

If settings.txt does not exist, then it probably wasn't created during the installation process. The installer should do this for you, but the manual install does not. If you used the installer and do not see the settings.txt file, then there is probably a bug in the installer that I'd be interested in tracking down and fixing.

The settings file should contain content similar to:

root: C:\Users\Corey\AppData\Roaming\nvm
path: C:\Program Files\nodejs

thank you... I used the zip file to use nvm... there is not this file in zip not intallable... then I created it with this information and did work...

@kiraio-moe
Copy link

kiraio-moe commented Jan 2, 2024

Quick Fix

  • Go to nvm-windows installation.

  • Run install.cmd as Admin. (Optional)

  • Open settings.txt and set your current nvm-windows and nodejs paths:

    root: C:\Programs\nvm
    path: C:\Programs\nodejs
    arch: 64
    proxy: none
    
  • Copy settings.txt to C: drive.

  • Open your Environment Variables and set the NVM_HOME & NVM_SYMLINK paths same as in settings.txt:

    nvm-windows_env-settings

  • Restart your machine. (Optional)

@jefflomax
Copy link

Also ran into this on Windows 10 22H2 19045.4291
Moving the settings.txt file to c:\ works - otherwise the very specific error opening settings.txt
LONG SURVIVING BUG

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests