72

I just installed NVM for Windows, but it doesn't seem to be working:

nvm from command line

Any ideas?

Felix
  • 3,783
  • 5
  • 34
  • 53

31 Answers31

107

First examine your actual "C:\Program Files\nodejs" directory. Most of us already have a "nodejs" directory from a prior install, before we decided (or were told) to install nvm.

In the end, this "C:\Program Files\nodejs" directory will actually be a shortcut to where nvm manages the versions it installs (see C:\Users\xxx\AppData\Roaming\nvm). It seems that nvm is simply switching the shortcut, when we call "nvm use ...".

Ok, so here is what I did to fix the situation where "nvm use ..." was not taking effect.

  1. Delete/remove/uninstall the version of node in your "C:\Program Files\nodejs" directory. To the point where there is no more "nodejs" directory at all.
  2. Delete the existence of nvm (C:\Users\xxx\AppData\Roaming\nvm), basically, manually delete the nvm dir.
  3. Download your desired version of nvm (https://github.com/coreybutler/nvm-windows/releases)
  4. Open a CMD prompt (run as administrator), and install the downloaded version of nvm, nvm-setup.exe, from within this CMD command prompt.
  5. From within the admin level command prompt, run "nvm install 7.2.1", or whatever node version you want to install. Probably you will be installing multiple versions, so repeat as needed.
  6. Now do the usual "nvm use ...", "nvm list", etc...

I dont know if this is the best way, but it worked for me...

Sagan
  • 2,033
  • 2
  • 14
  • 12
  • 5
    This is what solved it for me. Also for reference: https://github.com/coreybutler/nvm-windows/issues/321#issuecomment-382396940 – xiaodeaux Dec 19 '18 at 02:39
  • 1
    most proper working solution for at least Windows 7 – void Nov 06 '20 at 10:07
  • 2
    If the "nodejs" directory isn't already a shortcut, then it must be deleted so that the nvm commands can recreate it properly. (On Windows, the folder is displayed in the file browser with a shortcut icon when it's a proper shortcut, and the Properties will have a Shortcut tab indicating that the folder is a shortcut.) This was the step that fixed the issue for me. – dpmott Dec 14 '20 at 22:40
  • 2
    One note: I had the problem that node didn't show up as installed at first, but when I closed cmd and reopened (same with VS Code) it work as expected. Otherwise very helpful answer! – Zpeed Tube Jul 10 '21 at 13:06
  • You saved me. It really works! Real guid on using nvm windows. – Tatyana Molchanova Jul 31 '21 at 06:39
  • nvm install latest; nvm use latest – Uneconscience UneSource Aug 22 '22 at 12:39
  • This is why the README explicitly recommends removing old versions of Node before installing NVM4W. This is something that impacts all version managers, not just NVM4W. https://github.com/coreybutler/nvm-windows#installation--upgrades – Corey Nov 08 '22 at 14:30
  • Can't believe installing nvm messes up eveyrhting to do with node. Could they not have put a warning promt before installation telling you that you should 1st uninstall node. So frustrating. – Franco Feb 22 '23 at 16:40
39

Having the same issue after installing latest node with nvm. node command was not recognized in console. Closing and opening command windows did not work. checked nvm arch to which the response is

    C:\WINDOWS\system32> nvm arch
    System Default: 64-bit.
    Currently Configured: -bit.

Had to set the node again with arch setting

    C:\WINDOWS\system32> nvm use 7.4.0 x64
    Now using node v7.4.0 (64-bit)
    C:\WINDOWS\system32> nvm arch
    System Default: 64-bit.
    Currently Configured: 64-bit.
    C:\WINDOWS\system32> nvm list

    * 7.4.0 (Currently using 64-bit executable)
      4.5.0
    C:\WINDOWS\system32> node -v
    v7.4.0
Jash
  • 736
  • 6
  • 9
33

Rename "C:\Program Files\nodejs" to "C:\Program Files\nodejsx"

nvm use x.x.x

This worked for me. Maybe it will work for you too.

Melon
  • 604
  • 1
  • 7
  • 30
Subham Goyal
  • 806
  • 9
  • 9
  • 1
    BEAUTIFUL. This worked for me. At this point I unistalled node, nvm, and removed the Environement variables. Then I installed NVM, and with Node I installed versions. I think I needed to use `nvm on` however, this did the freaking trick. – DeadlyChambers Jun 03 '20 at 06:20
  • 2
    Yes - this worked. What it told me was that the nvm installer was not able to remove the existing `nodejs` directory during installation. Simply renaming this allowed `nvm` to create a new directory pointing to the correct location. The original `nodejsx` directory can now be deleted. – jeremysawesome Oct 27 '20 at 20:25
  • Amazing. Fresh install of nvm, ran nvm install x.x.x, and node was not recognized as a command until I ran the command in this answer. Not intuitive, but c'est la vie. Thanks so much. – IRCraziestTaxi Jul 14 '21 at 06:29
  • I am currently using a Portuguese version of the windows, so I needed to change also the folder for the brazilian name of the repository and change it into the configuration file of the nvm and it did work. Thanks! – guilfer Nov 03 '21 at 20:14
13

I had the same problem in Windows 10, and the solution for me was in @pleverett answer in https://github.com/coreybutler/nvm-windows/issues/191

Symptoms: no bit architecture and no default version

C:\WINDOWS\system32> nvm arch
System Default: 64-bit.
Currently Configured: -bit.

C:\WINDOWS\system32> nvm list
8.9.4
6.13.0

Solution: After uninstalling node, make sure the directory where node was originally installed has been removed and not just empty. For Windows 7 ad 10, 64-bit, the default is "C:\Program Files\nodejs".

If the "nodejs" directory still exists then the "nvm use" command can't make the symbolic link to the node version under nvm's control.

I had the same problem until I manually deleted the "nodejs" directory.

Troglo
  • 1,497
  • 17
  • 18
13
  1. Make sure you delete all old nodejs.
  2. Install nvm
  3. Install node
  4. Open new terminal prompt
  5. run 'nvm on'
  6. run 'nvm list'
  7. run 'node --version'
Adam Orłowski
  • 4,268
  • 24
  • 33
12

Most likely what is happening is that the system %PATH% is being updated outside of the command prompt instance. Only opening a new command prompt will pick up these new external changes.

mscdex
  • 104,356
  • 15
  • 192
  • 153
  • 1
    For future onlookers, this is a problem that only exists on some systems. The installer logically modifies the path before the prompt is opened. In most environments, this happens as expected, so it just works. However; sometimes the installer opens the command prompt a split second before it completes the path modification, thus causing this problem. I've tried to force the installer to wait, but it appears to be a bug in the InnoLogic execution (operates asynchronously when it should be synchronously). The next version will use a different installer, because this is unnecessarily annoying. – Corey Feb 01 '16 at 15:24
  • 4
    I have the same problem as OP but the solution proposed here is not working for me! I have nvm 1.1.1 and have installed node 0.10.15 from it. I get "The system can not find the path specified" error when I run node. I had node installed before installing nvm, so as per the instructions, I uninstalled it and deleted the npm directory. Still no luck! – Vikram Jul 29 '16 at 15:13
  • I had a previous nodejs installation (not done w/ NVM). I had to remove it and it's %PATH% entry for nvm to properly set the path. – zmf Jan 31 '17 at 05:14
  • Sometimes you actually need to reboot the system. – JeffRSon Sep 02 '21 at 09:04
4

I had to manually set the PATH variable in System environment variables of Windows to fix this issue.

Here are the steps:

  1. Before installing nvm, delete the following path:

    C:\Program Files\nodejs C:\Program Files (x86)\nodejs

  2. after installing nvm execute: nvm use

  3. After the use command you can find a shortcut 'C:\Program Files\nodejs' is created by nvm in this path.

  4. The problem i found was the path 'C:\Program Files\nodejs' was not set in the windows system evnironment PATH variable.

  5. i appended 'C:\Program Files\nodejs' to the %PATH% variable to fix this issue.

chanderdevx
  • 151
  • 2
  • 8
3

In my case I was using git bash -- switching to cmd.exe worked.

More suggestions at: https://github.com/coreybutler/nvm-windows/issues/58

giraffe.guru
  • 480
  • 8
  • 21
  • 1
    +1 for this solution. For Windows 10 it appears that gitforwindows does not like running `nvm use 14.15.0`. – Navigatron Nov 10 '20 at 23:04
3

I had to open the installer with admin permissions. Then I opened the command line and I was able to install and use nvm properly.

nvm install 10.0.0
nvm use 10.0.0
node --version
// version 10 is used.
caraie
  • 1,094
  • 7
  • 18
  • This was the trick for me... admin permissions when running `nvm install` and also specifying the full version (major/minor/point) on `nvm use`. – tom Jul 16 '22 at 12:49
2

I installed nvm-windows in order to get multiple versions of node to work. After installation I got the error that most folks complained about which is that it was unable to find the file settings.txt. There are two things required to get nvm-win to work and the installer only does the first of these two. So after installation just check that points 1 and 2 are covered and you should be good. There is no need to uninstall prior versions of node as far as i can tell.

  1. update the system path variable to the directory where you installed nvm and where the nvm.exe is located. ex. c:\nvm
  2. add a new variable NVM_HOME to the system variables.
  3. open a new command window after verifying 1 and 2.

Problem 2 switching between versions

Switching between versions gives a success message but it will not actually work properly unless you manually update the windows system path variable to point to the location that you installed your target version in, for example C:\Users\adamm>nvm list

10.15.1

* 6.4.0 (Currently using 64-bit executable) So it appears to work but if you type node -v it will show whichever version is currently in your path variable until you edit the path variable to use 6.4.0

Eric Aya
  • 69,473
  • 35
  • 181
  • 253
2

I was getting the same issue. I installed node using nvm but 'node' and 'npm' were not recognized by the system.

So, what I did was I didn't delete any folders or anything I just ran the command prompt as administrator and did the nvm install 'desired-version' and everything started to work fine.

d_bhatnagar
  • 1,419
  • 1
  • 12
  • 20
2

For me it was I installed node using nvm on a non-admin cmd. Running cmd as admin worked for me.

open a new cmd with admin rights then run this command.

run 'nvm on'
Rishabh Gusain
  • 683
  • 1
  • 6
  • 23
2

I understand this is an old question. However, what fixed it for me isn't in any of the answers above, which is why I decided to answer this in case new persons find this page and none of the above answer works for them...

All I had to do was run nvm on which creates the symlink (supposedly, nvm use <version> is supposed to work, but it wasn't), turning on nvm before using a version worked for me.

Steps:

  1. nvm install <version> -> Installs a node and npm of <version>
  2. nvm on -> Turns on nvm, and creates the nodejs symlink needed
  3. nvm use <version> -> To use a specific version
  4. node -v -> prints out version of node
  5. npm -v -> prints out version of npm

Hopefully, it fixes your issue too.

Isaac Frank
  • 41
  • 1
  • 5
1

For me,

nvm list

image

Then I remove v8.9.4 folder out of nvm.

image

After that:

nvm list

image

Then, I move v8.9.4 back.

xianshenglu
  • 4,943
  • 3
  • 17
  • 34
  • Thanks @xianshenglu. This solution worked for me. Only difference being that I could not reuse the version folder. I needed to run nvm install to grab a fresh install of the version that was moved. – James Shaw May 04 '20 at 18:19
1

This work fine for me:

In the C:\Program Files\ folder use cmd to run mklink /D /J nodejs C:\Users\[user]\AppData\Roaming\nvm[node version]

Please note that cmd run in administrator mode.

Detail here: https://github.com/coreybutler/nvm-windows/issues/321#issuecomment-407876718

1

You must delete your C:\Program Files\nodejs directory.

Check the version of the node available with nvm list. If you have your version, run command nvm use x.x.x.

otherwise run nvm install x.x.x and run command nvm use x.x.x.

Rahul Purohit
  • 540
  • 4
  • 16
0

Why isn't node version changing with nvm for windows even when nvm on ?

when nodejs is already installed, the enviroment variable NVM_SYMLINK which created when nvm for windows is installed will point to C:\Program Files\nodejs(which is default)

what is the expected behavior ?

when we run nvm on and then nvm use x.x.x, we should able to switch to the desired node version without any hassle.

how to fix ?

  1. uninstall the nodejs using uninstall/remove programs from control panel and delete C:\Program Files\nodejs if exists
  2. check (once) if NVM_SYMLINK in environment variables is changing automatically when running nvm use x.x.x
  3. if not changing automatically then uninstall and reinstall nvm for windows (remove any other node remains)

Note: I am able to switch to the desired versions of node by changing the user environment variable NVM_SYMLINKto C:\Users\Charlie\AppData\Roaming\nvm\vx.x.x without uninstalling the node.

Charles Dominic
  • 345
  • 3
  • 8
0

At my work we are assigned a user account and an administrative account which we use to install and manage software for our machines. NVM was installed under this admin account and therefore, none of the answers above worked for me.

I had to manually add %NVM_HOME% and %NVM_SYMLINK% to my user account's path before I could get node --version to display anything.

So if you have to deal with a regular account and an administrative account then the following will work for you:

  1. Install NVM (which will have to be installed using your admin account)
  2. Manually added %NVM_HOME% and %NVM_SYMLINK% to your user account's path (if you check your admin account's path you'll see these 2 were added there during the NVM installation)
  3. nvm install latest
  4. nvm on
  5. nvm use x.x.x
  6. Restart computer so your IDE recognizes the changes
  7. $Profit$
Luminous
  • 1,771
  • 2
  • 24
  • 43
0

To me the issue was that I had problems with the download, I had to download the zip file manually and place its contents int he nvm folder C:\Users\xxx\AppData\Roaming\nvm

pedrommuller
  • 15,741
  • 10
  • 76
  • 126
0

Try nvm run node --version


You can also get the path to the executable to where it was installed:

nvm which 5.0

Ritu Gupta
  • 2,249
  • 1
  • 18
  • 11
0

Something that fixed it for me: Comb through your PATH variable. I had multiple links to different node versions and it worked perfectly after I cleaned up all of them, leaving NVM's variables in tact.

If executing where node comes back with more than one path this is likely your issue.

user37309
  • 597
  • 5
  • 14
0

For me, the issue was that I was using the nosetup way and downloaded the zip in my user Downloads folder. When I switched to setup installer, it worked for me.

Kishu Agarwal
  • 378
  • 3
  • 8
0

You need Administrator access for installing node. Since you got into problem before knowing solution, follow below step.

  1. Note down all installed node version(Optional)
  2. "C:\Program Files\nodejs" (Optional but Recommended)
  3. Delete "C:\Users\xxx\AppData\Roaming\nvm"
  4. Reinstall nvm
  5. Run cmd as Administrator
  6. nvm install x.x.x
0

I had same issue. C:\Program Files\nodejs shortcut folder was present but was not pointing to anywhere.

I simply deleted the C:\Program Files\nodejs symlink and executed the below command nvm use 0.10.36

This created new C:\Program Files\nodejs symlink and it worked properly.

0

Aside to all other solutions described here, there is another issue with nvm. Nvm switches between version of Node.js. Node.js builds are grabbed from Node.js repository.

If you can switch between some versions, but not all, and specifically you can not switch to versions you just grabbed, that answer is for you.

The situation happens because Node.js rebuilds old builds. For example, there is a build 10.14.1 you can grab from their repository, and that nvm grabs. But it is not a build from the past. Node.js rebuilds old builds too regularly.

Unfortunately, they don't take care about backwards compatibility. It means that if your operating system is not supported by Node.js, not only the latest build won't be supported. All old builds will also be broken for your system.

Currently, Node.js supports Windows 10+. It means that all old Node.js packages has been rebuilt in a way, that break them for Windows 8.x and Windows 7.

What is astonishing, there is no place to grab the old, working builds. Once they rebuild old releases, they break backwards compatibility.

As for now, there is no solution for that. The only thing you can do, is to grab releases while they are supported on your system. For example now, you can grab versions for Windows 10, because when they announce Windows 11 is a minimum requirement, all Node.js builds will break on Windows 10.

From the nvm perspective, you can see any kind of errors during the installation. During switching the visible result is that you can not switch between versions. The version you choose is not the current one and not marked with an asterix in the npm list result.

Tom Smykowski
  • 25,487
  • 54
  • 159
  • 236
0

For me there were 2 things I needed to do:

  • Run nvm install as administrator
  • Specify the exact version (major.minor.point) with nvm use

Steps:

  1. Open Terminal as Administrator
  2. Run nvm install 14
  3. Run nvm use 14.20.0
  4. Open Terminal as non-admin
  5. Run node -v to verify it's using 14.20.0

If I tried nvm use 14 without minor or point version, it did not work, which differs from NVM on Mac. I also could not run nvm use in a non-admin terminal, it gave "Access is denied".

tom
  • 1,331
  • 1
  • 15
  • 28
0

For me deleting npm and npm-cache folder from AppData works

0

For me running nvm install 14.0.0 from PowerShell with admin rights did the job.

  • Welcome to SO! Usually duplicate answers are not allowed in [StackOverflow](https://meta.stackoverflow.com/questions/415351/duplicate-answers-in-low-quality-answers-re-flag-or-delete) (I count at least 6 answers telling to raise cmd prompt), mainly if it is a late answer like yours. – Marcelo Scofano Diniz Dec 30 '22 at 15:01
0

For me what worked was to reinstall nvm to the latest version (1.1.11) which now automatically asks to be granted administrative privileges when necessary (in my case when running the command nvm use x.x.x)

Fede Garcia
  • 677
  • 11
  • 18
0

For me the problem was I installed node from installer file previously. So, the solution was to uninstall it from Program and Features in windows. Then run nvm use (whatever version)

Pablo García
  • 359
  • 3
  • 9
-1

For me setting up environment path variable also didn't work. Finally I got the cause and it was incompatible node version, once I downgraded my node from 14 to version used in my frontend application i.e. v8.11.3, it worked for me.

bad_coder
  • 11,289
  • 20
  • 44
  • 72
Rinku Jain
  • 200
  • 3