Nvm-windows: Installing nvm-windows on multiple user accounts interferes with each other

Created on 16 Dec 2017  路  8Comments  路  Source: coreybutler/nvm-windows

My Environment

  • [X] Windows 10

I'm using NVM4W version:

  • [X] 1.1.5

I have already...

  • [X] read the README to be aware of npm gotchas & antivirus issues.
  • [X] reviewed the wiki to make sure my issue hasn't already been resolved.
  • [X] verified I'm using an account with administrative privileges.
  • [X] searched the issues (open and closed) to make sure this isn't a duplicate.
  • [X] made sure this isn't a question about how to use NVM for Windows, since gitter is used for questions and comments.

My issue is related to (check only those which apply):

  • [X] A standard shell environment (terminal/powershell)

Expected Behavior

nvm-windows should work for any user account that installed it, without interfering with the other account.

Actual Behavior

Installing nvm-windows in one account affects the other user account, rendering the former unable to use nvm-windows on the command line.

Steps to reproduce the problem:

Given two user accounts, UserA and UserB on Windows 10.

  1. UserA installs nvm-windows and can use it initially. UserA logs off.
  2. UserB logs in, but cannot use nvm-windows -- his powershell says the command is not found, so he installs nvm-windows during his own session.
  3. After that, UserB logs out and UserA logs back in. UserA can no longer use nvm-windows.

Comments

So is it by design that nvm-windows can only be used by one user account?

Most helpful comment

Just hit this same issue. It appears to be a result of the default installation folder being located under the install user's home folder. (C:\Users\XXX\AppData\Roaming\nvm) Other users on the machine will be denied access to that folder.

Try removing nvm and re-installing to a common folder location such as "C:\nvm".

All 8 comments

Just hit this same issue. It appears to be a result of the default installation folder being located under the install user's home folder. (C:\Users\XXX\AppData\Roaming\nvm) Other users on the machine will be denied access to that folder.

Try removing nvm and re-installing to a common folder location such as "C:\nvm".

@b-dur / @coreybutler - is there a reason any part of NVM needs to be installed globally on a machine? Or maybe rephrased - can't every part of NVM just be installed under Local AppData and the appropriate paths added to the current user's environment? This way any individual user's install of NVM and the currently in-use version of node/npm is completely independent of anyone else's? On Windows 10 anyway, I wouldn't see any problems with this; I'm pretty sure there wouldn't be any under Win7+.

@mattzuba I don't think there is anything blocking NVM for being installed in a global path. This PR #346 should fix this issue when merged.

I made this pre-release that hopefully should fix this bug: https://github.com/b-dur/nvm-windows/releases/tag/1.1.7
Can anyone confirm that?

Thank you for this.

I tried this pre-release on Windows 10. nvm installed into C:\ProgramData\nvm and I was able to access it from an account other than the one that installed it.

I hope I'm not off topic by mentioning this, but I am having one glitch with the environment variables created by this installer. NVM_HOME and NVM_SYMLINK are created as system-level environment variables, and both are inserted into the system-level path as %NVM_HOME% and %NVM_SYMLINK%, but the command interpreter doesn't resolve them into actual pathnames, and thus I can't find the executables. I'm working around this issue by adding %NVM_HOME% and %NVM_SYMLINK% to my user-level PATH environment variable. Windows resolves them into actual pathnames if I do that.

The problem still persists in the "1.1.7 - Maintenance Release". When I start the setup on a normal user account in Windows 10, I am prompted for an admin password. Later the "Select Destination Location" dialog defaults to the "C:\Users\XXX\AppData\Roaming\nvm" directory, where "XXX" is the admin user.

Same experience with both the previous comments.

I installed NVM in a global folder like @JohnMilazzo suggested and it started to work AFTER I logged off in all accounts and restarted Windows.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

petrovicz picture petrovicz  路  4Comments

eliavmaman picture eliavmaman  路  6Comments

thany picture thany  路  4Comments

fredericrous picture fredericrous  路  3Comments

martijnsenden picture martijnsenden  路  3Comments