Nvm-windows: Install problem(s)

Created on 24 Nov 2014  路  11Comments  路  Source: coreybutler/nvm-windows

Ok, I'm having a lot of issues, but I would LOVE to get this working on my windows desktop instead of my older mac laptop. Thanks very much in advance for creating nvm for windows! I'm using Win7 64-bit.

The installer puts the files in my username\AppData\Roaming folder by default. Is this correct behavior? If these files follow me to another windows computer, will everything still work?

When cmd.exe is run at the end of the installer, it complains about a missing \settings.txt, even though it is present. If I close that cmd.exe and start a new one, the error message goes away. (Possibly the cmd.exe launched from the installer has not yet picked up the new %path% environment variable?)

Even though the '\settings.txt' error message has gone away from subsequent cmd.exe invocations, the path is still not set up properly-- %NVM_HOME% and %NVM_SYMLINK% are listed when I inspect the path from the command line. (I mentioned this in another issue thread. Workaround is to add the proper dirs to the path manually a la "set path=%path%;%nvm_home%;%nvm_symlink%").

When I open up Win7's 'Environment Variables' dialog box, it looks like the two nvm-windows variables are both in my User Variables as well as my System Variables. I'm not used to seeing variables duplicated like that.

Running "nvm use [...]" causes two separate windows security dialogs to open due to making changes to the symlink in \Program Files.

I run "nvm install 0.10.33" and it seems to work, but only after I run "nvm use ..." which is a little odd since this is the first and only node.js I've installed thus far. But maybe that's how the 'nix versions work.

When I then install another node.js, 0.11.14, install succeeds. When I "run nvm use 0.11.14" that works too. And when I run "nvm list" I can see my two installed versions, although I'm seeing "?-bit executable" instead of "64-bit".

When I try and switch from 0.11.14 to 0.10.33, I get the error "node v0.10.33 (64-bit) is not installed." I get a similar error when I run "nvm use 0.11.14".

So then I run the uninstaller for nvm-windows in the control panel. For some reason a new PATH variable is now added to my User variables where none was there before. It appears to be a copy of my System variable PATH. So now when I open a cmd.exe, my PATH is doubled in size and content. (Deleting my User variable for PATH fixes this.)

Most helpful comment

Hi,

I also had problems with the path but it was easily fixed by removing NVM_HOME and NVM_SYMLINK from the user variables (don't touch the system variables).

Here is why

All 11 comments

Some of this is expected behavior, some is not.

Placing the files in username\AppDData\Roaming\nvm is the expected default action. If your environment is setup to use roaming profiles, then the files should follow to another machine, but the environment variables may not... completely depends on the how the environment is configured. This is normally something handled by Active Directory networks, so if the group policy copies system variables, then it should work smoothly.

I think there is a timing issue with the installer. Frankly, I've spent more time on the installer than the tool and I'm planning to put together a new installer using BitRock's system as soon as I have time. This should alleviate a lot of these problems The Innosetup installer currently used has shown sporadic issues outside of Windows 8.

The environment variables are supposed to exist in both the local and system levels. It's not terribly common, but this is what allows the shell to immediately recognize the executable.

Are the multiple windows you're experiencing similar to what is seen in issue #4? Or are these with Windows UAC prompts? If you're seeing the prompts, make sure you check your user account permissions. NVM for Windows does elevate the privileges to avoid this, but the user account must still have admin privileges. Another option is to use a symlink that's not in C:\Program Files.

Yes, the unix version of NVM requires you to run nvm use ... the first time or any time you switch the environment. It makes sense to automatically use the first installation of node though... that's on my list of enhancements.

The ?-bit issue is one I'm still trying to pinpoint. Another user had this issue, but I lost touch and have not been able to recreate the problem. I suspect this may be an issue with not having a specific executable in Windows 7.... it's supposed to be there, but I'm coming across a few folks who have not had it. If you navigate into any of the node directories and run file node.exe, it should respond with something that looks like PE32\. The relevant code is at https://github.com/coreybutler/nvm-windows/blob/master/src/nvm/arch/arch.go#L10-L21, but as you can see, it uses ? when it encounters an error. I have not been able to manually recreate this error and am looking for assistance from anyone who can attempt to run that and tell me what the output is.

I believe the issue above is the root of the same problem for receiving an erroneous X.X.X not installed message.

I'm certainly willing to fix these issues... if I can track down what the cause is. At the moment, I don't have a Win7 box to try this on and can't recreate the issues, so any test results you have for the above scenario would be very useful.

Thanks for the reply! Sorry you are spending so much time on the installer; I can totally understand what a bummer that'd be. I appreciate you taking the time to figure this stuff out.

The multiple windows I was talking about are Windows UAC prompts. My user is an administrator. I just tried having the installer use my home folder but still encountered the UAC prompts. Not the end of the world, but a little odd.

Ok, hmm.. My Win7 does not appear to have a "file" command. I'm downloading it now from here:
http://gnuwin32.sourceforge.net/packages/file.htm
I wonder if other GnuWin32 commands are also required?

Hey cool: I just installed file.exe, added it to my path, and now nvm no longer reports "?-bit" ! And it can switch back and forth between node versions without telling me I don't have them installed. Thanks!!!

@bobbycircle - Thank you so much for this feedback. Until Go has a better native way to detect the bitness of a file on Windows, I'm going to bundle the file.exe command. Despite Microsoft's documentation, it appears the command does not ship with all versions of Windows after XP.

I'll see if I can get a test environment setup for Windows 7 to explore the UAC prompts. That definitely shouldn't be happening.

Thanks again.... really appreciate your help! I am going to close this issue after I separate the content of this thread into multiple issues... then I'll tackle them one by one and close them as the new code is released.

Hi,

I also had problems with the path but it was easily fixed by removing NVM_HOME and NVM_SYMLINK from the user variables (don't touch the system variables).

Here is why

@colmsjo - I assume you were seeing duplicates in your path then?

I saw the raw strings like %NVM_HOME% in the path. Windows has some security pre-causions not to include variables from user space to the system space (I did not check all the details but it fixed the problem).

Just to clarify, I only saw duplicates in my path after I uninstalled.

@colmsjo Thanks! Removing the user vars, fixed my issues.

@coreybutler (I was seeing the duplicates.)

Thanks, @colmsjo! This has taken me awhile to figure out. I also needed to add a NODE_PATH (set to C:\Users{USER}\AppData\Roaming\npm), which I didn't have previously.

@colmsjo I had to remove duplicate NVM_HOME and NVM_SYMLINK user variables as well, but I couldn't find much of an answer to why outside of an acknowledgement in a comment on one of the answers.

Stale. If this issue crops up again, please open a new issue.

Was this page helpful?
0 / 5 - 0 ratings