Code Monkey home page Code Monkey logo

Comments (65)

queckezz avatar queckezz commented on May 23, 2024 13

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.

from nvm-windows.

coreybutler avatar coreybutler commented on May 23, 2024 4

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

from nvm-windows.

SleeplessByte avatar SleeplessByte commented on May 23, 2024 3

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

restart cmd.exe and you're good

from nvm-windows.

abcfy2 avatar abcfy2 commented on May 23, 2024 1

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

from nvm-windows.

Schurke avatar Schurke commented on May 23, 2024 1

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.

from nvm-windows.

romualdr avatar romualdr commented on May 23, 2024 1

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.

from nvm-windows.

zyonet avatar zyonet commented on May 23, 2024 1

run your cmd terminal as adminstrator

from nvm-windows.

PyroSA avatar PyroSA commented on May 23, 2024 1

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.

from nvm-windows.

jsheely avatar jsheely commented on May 23, 2024 1

After it didn't work from the initially loaded "Run Cmd". I loaded an administrator cmd and ran nvm list which worked. Then when I went back to a regular cmd window it continued to work.

from nvm-windows.

AdrianoCahete avatar AdrianoCahete commented on May 23, 2024 1

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

from nvm-windows.

kiraio-moe avatar kiraio-moe commented on May 23, 2024 1

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)

from nvm-windows.

coreybutler avatar coreybutler commented on May 23, 2024

Does the settings file exist in your installation directory?

from nvm-windows.

megant avatar megant commented on May 23, 2024

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

from nvm-windows.

bobbycircle avatar bobbycircle commented on May 23, 2024

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.

from nvm-windows.

coreybutler avatar coreybutler commented on May 23, 2024

@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.

from nvm-windows.

noizyboy avatar noizyboy commented on May 23, 2024

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

from nvm-windows.

dan-sterling avatar dan-sterling commented on May 23, 2024

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.

from nvm-windows.

coreybutler avatar coreybutler commented on May 23, 2024

@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.

from nvm-windows.

okonomiyaki3000 avatar okonomiyaki3000 commented on May 23, 2024

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

from nvm-windows.

gmarziou avatar gmarziou commented on May 23, 2024

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.

from nvm-windows.

jimbriam avatar jimbriam commented on May 23, 2024

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.

from nvm-windows.

kaibadash avatar kaibadash commented on May 23, 2024

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

from nvm-windows.

tomyam1 avatar tomyam1 commented on May 23, 2024

@bobbycircle solution worked for me.

from nvm-windows.

bartread avatar bartread commented on May 23, 2024

Just ran into this on Windows 8 as well.

from nvm-windows.

PureKrome avatar PureKrome commented on May 23, 2024

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?

from nvm-windows.

vineelp avatar vineelp commented on May 23, 2024

@queckezz solution worked

from nvm-windows.

matthieu-rolland avatar matthieu-rolland commented on May 23, 2024

@queckezz solution worked. thank u

from nvm-windows.

arizonatribe avatar arizonatribe commented on May 23, 2024

@queckezz solution also worked for me. Thanks

from nvm-windows.

wch4896 avatar wch4896 commented on May 23, 2024

@queckezz solution worked +1

from nvm-windows.

giggio avatar giggio commented on May 23, 2024

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%.

from nvm-windows.

sanori avatar sanori commented on May 23, 2024

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

from nvm-windows.

mthebert-mmd avatar mthebert-mmd commented on May 23, 2024

+1 for @sanori and rebooting after install fixing

from nvm-windows.

 avatar commented on May 23, 2024

The problem is that PATH was not correctly updated, meaning that in my case I found that PATH value was ...";%NVM_HOME%;%NVM_SYMLINK%. Those ... are the existing entries, but a double quotes was added before semi colon.

Once this was corrected, PATH = ...;%NVM_HOME%;%NVM_SYMLINK% everything works correctly.
You don't have to copy settings.txt in C:, D: or whatever drive you are using when running nvm tool.

from nvm-windows.

PyroSA avatar PyroSA commented on May 23, 2024

I also noticed the %vars% in my path, but by then had reverted to just having the active version of Node installed, so just removed them.

I can't believe they (MicroSoft) haven't improved the systems properties method of modifying the path. I'm sure it's been the same narrow textbox since XP days.

from nvm-windows.

giggio avatar giggio commented on May 23, 2024

Setting env vars on Windows works just fine. You can even do it from powershell:

[System.Environment]::SetEnvironmentVariable("MYVAR", "WHATEVER", "Machine")

from nvm-windows.

jshbrntt avatar jshbrntt commented on May 23, 2024

I fixed this issue by going to %AppData%/nvm and changing the security of the settings.txt file so Everyone had full full access to the file.

If you'd prefer not to do this you could also try running nvm from command prompt with elevated privileges. Using run as administrator.

from nvm-windows.

vbdoug avatar vbdoug commented on May 23, 2024

I got this error when I installed the first time. Then I ran the installer as administrator, all is well.

from nvm-windows.

mlekena avatar mlekena commented on May 23, 2024

I installed is and all that needed doing was to restart windows. I get the sense that cmd just needed to get reset with the new Environment variables.

from nvm-windows.

muthuridennis avatar muthuridennis commented on May 23, 2024

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

from nvm-windows.

 avatar commented on May 23, 2024

+1 restart on Win7

from nvm-windows.

MarkPieszak avatar MarkPieszak commented on May 23, 2024

For anyone who can't get it working either :: TRY THIS

Just close all your instances of CMD prompt and re-open as Administrator (just in case).
Fixed it for me

from nvm-windows.

olegkalyta avatar olegkalyta commented on May 23, 2024

@mcpDESIGNS thank you, it helped me too!

from nvm-windows.

AdrianoCahete avatar AdrianoCahete commented on May 23, 2024

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

from nvm-windows.

ackvf avatar ackvf commented on May 23, 2024

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.

from nvm-windows.

li-tkiefer avatar li-tkiefer commented on May 23, 2024

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

from nvm-windows.

coreybutler avatar coreybutler commented on May 23, 2024

FYI: Windows 7 support = deprecated.

from nvm-windows.

coreybutler avatar coreybutler commented on May 23, 2024

@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.

from nvm-windows.

dcorto avatar dcorto commented on May 23, 2024

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

from nvm-windows.

kukuruznik avatar kukuruznik commented on May 23, 2024

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)

from nvm-windows.

coreybutler avatar coreybutler commented on May 23, 2024

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.

from nvm-windows.

mandaputtra avatar mandaputtra commented on May 23, 2024

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

from nvm-windows.

mandaputtra avatar mandaputtra commented on May 23, 2024

Sorry just restart the computer and its work πŸ’―

from nvm-windows.

TomasHubelbauer avatar TomasHubelbauer commented on May 23, 2024

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).

from nvm-windows.

toddalbers avatar toddalbers commented on May 23, 2024

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.

from nvm-windows.

Fadeoc avatar Fadeoc commented on May 23, 2024

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

from nvm-windows.

coreybutler avatar coreybutler commented on May 23, 2024

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.

from nvm-windows.

Muizuddeen avatar Muizuddeen commented on May 23, 2024

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.

from nvm-windows.

SleeplessByte avatar SleeplessByte commented on May 23, 2024

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

from nvm-windows.

emallove avatar emallove commented on May 23, 2024

I hit this issue on v1.1.9.

from nvm-windows.

DigDugIA avatar DigDugIA commented on May 23, 2024

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.

from nvm-windows.

chill389cc avatar chill389cc commented on May 23, 2024

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.

from nvm-windows.

jimtut avatar jimtut commented on May 23, 2024

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.

from nvm-windows.

JackAllread avatar JackAllread commented on May 23, 2024

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.

from nvm-windows.

rushian avatar rushian commented on May 23, 2024

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...

from nvm-windows.

jefflomax avatar jefflomax commented on May 23, 2024

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

from nvm-windows.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.