Nvm-windows: Fresh install doesn't add nvm to path on Win 7

Created on 30 Dec 2016  路  9Comments  路  Source: coreybutler/nvm-windows

My Environment

  • [x] Windows 7 or below (not truly supported due to EOL - see wiki for details)
  • [ ] Windows 8
  • [ ] Windows 8.1
  • [ ] Windows 10
  • [ ] Windows 10 IoT Core
  • [ ] Windows Server 2012
  • [ ] Windows Server 2012 R2
  • [ ] Windows Server 2016

  • [ ] My Windows installation is non-English.

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

  • [ ] settings.txt
  • [ ] proxy support
  • [ ] 32 or 64 bit support

Expected Behavior

As the readme says, after installing, I should be able to open a command window and type nvm to get more help.

Actual Behavior

Installer reported no errors, but:

C:\Users\me>nvm
'nvm' is not recognized as an internal or external command,
operable program or batch file.

Steps to reproduce the problem:

  1. install using nvm-setup.exe (version 1.1.1) either as a non-admin user or by right-clicking and choosing Run as Administrator
  2. open command prompt
  3. type nvm
  4. press enter

Most helpful comment

Can confirm this, here is my output of the two envorinment variables:

位 echo %NVM_HOME%
C:\Users\thunder\AppData\Roaming\nvm

位 echo %NVM_SYMLNK%
%NVM_SYMLNK%

NVM_SYMLNK seems to be empty

All 9 comments

Can confirm this, here is my output of the two envorinment variables:

位 echo %NVM_HOME%
C:\Users\thunder\AppData\Roaming\nvm

位 echo %NVM_SYMLNK%
%NVM_SYMLNK%

NVM_SYMLNK seems to be empty

Here's something interesting I found. I'd been previously unaware that each user could have their own environment variables in Windows. If you hit Start and type "env" you'll see such an option. In that window, which looks exactly like the system one you get via Computer Properties->Advanced->etc. except that it's for your user instead of for the administrator user, there are two sections, one for the user, one for system.

After these two install attempts, I see that my current user one doesn't have it under 'user', but it does exist under 'system'. In the admin user it exists in under 'user' (well, under both, but the system one is common to both.)

The problem for me is different than @timaschew : both of those env vars are defined (and echo properly at the command line) but nvm still doesn't find anything. AFAICT it's because %NVM_HOME% is defined using the admin user's AppData path, which my regular user account does not have access to.

OTOH this may just be because I installed first as my regular user, and then tried installing as admin. Let me try as a regular user again.

Ah, I see: simply double-clicking the installer does not install as my regular user--it asks for admin creds. I had thought it does this to confirm you want to install the software, not to actually switch over to be the admin while you install. Thus, in the installer, the default install directory is under the admin's appdata.

OTOH the symlink is under Program Files for the binary. I get the rationale of using AppData since you're going to install other things there, and also because you want to keep it separate per user, but is there no way to run the installer in a regular user context?

AFAICT it's because %NVM_HOME% is defined using the admin user's AppData path, which my regular user account does not have access to.

Wait, that's not true either. It's not finding nvm in the %PATH%. The installer adds %NVM_HOME% to the path, but not %NVM_SYMLINK%'s dir.

Does %NVM_HOME% have nvm.exe in it, for you?

I first installed in the default AppData Roaming, and received an error about installing unins000.exe (it complained about access permissions, I think).
Then, after checking, all the Env Vars were correct.
Then I checked the AppData dir, and noticed nvm.exe didn't exist.

I deleted everything, and re-ran the installer but changed the installation directory (to a different drive, fwiw). I didn't receive an uninstaller error, and nvm.exe exists in that directory, and all the Paths were correct.

The installer is designed for Windows 8.1+. If something fails in Windows 7, try the manual installation option (listed in the wiki).

Closing due to age and Windows 7 support.

Never ending path problems on windows 10.

So if I install in cmd using either local account or administrator account, I cannot call NPM from inside any batch files on the system that are running as administrator.

Any ideas?

I know this issue is closed but I'm having the same problem with Windows 8.1

On Win8.1+, close the terminal and re-open it. Sometimes Windows lags behind and sets the PATH after the terminal window opens. Reopening it fixes it. If not, open a new issue. These closed issues often get lost.

On Windows 7, nvm is installed under the administrator account. This is what I have done to resolve this:
During install of nvm, set the root path to (change to suit) C:\Node\nvm and change the Symlink path to C:\Node\nodejs

Nvm has now been added to your system/admin path but not your users'.

In the start menu, search for env and open Edit environment variables for your account.
Edit your path to include %NVM_HOME%;%NVM_SYMLINK%;

You should now be able to call nvm without using an administrator cmd window.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

thany picture thany  路  4Comments

fredericrous picture fredericrous  路  3Comments

tomByrer picture tomByrer  路  4Comments

janpio picture janpio  路  3Comments

leiamac picture leiamac  路  4Comments