I just installed NVM for Windows, but it doesn't seem to be working:
Any ideas?
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.
I dont know if this is the best way, but it worked for me...
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
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.
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.
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.
I had to manually set the PATH variable in System environment variables of Windows to fix this issue.
Here are the steps:
Before installing nvm, delete the following path:
C:\Program Files\nodejs
C:\Program Files (x86)\nodejs
after installing nvm execute: nvm use
After the use command you can find a shortcut 'C:\Program Files\nodejs' is created by nvm in this path.
The problem i found was the path 'C:\Program Files\nodejs' was not set in the windows system evnironment PATH variable.
i appended 'C:\Program Files\nodejs' to the %PATH% variable to fix this issue.
In my case I was using git bash -- switching to cmd.exe worked.
More suggestions at: https://github.com/coreybutler/nvm-windows/issues/58
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.
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.
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
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.
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'
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:
nvm install <version>
-> Installs a node and npm of <version>
nvm on
-> Turns on nvm, and creates the nodejs symlink needednvm use <version>
-> To use a specific versionnode -v
-> prints out version of nodenpm -v
-> prints out version of npmHopefully, it fixes your issue too.
For me,
nvm list
Then I remove v8.9.4 folder out of nvm.
After that:
nvm list
Then, I move v8.9.4 back.
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
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
.
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 ?
C:\Program Files\nodejs
if existsNVM_SYMLINK
in environment variables is changing automatically when running nvm use x.x.x
Note: I am able to switch to the desired versions of node by changing the user environment variable NVM_SYMLINK
to C:\Users\Charlie\AppData\Roaming\nvm\vx.x.x
without uninstalling the node.
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:
nvm install latest
nvm on
nvm use x.x.x
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
Try nvm run node --version
You can also get the path to the executable to where it was installed:
nvm which 5.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.
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.
You need Administrator access for installing node. Since you got into problem before knowing solution, follow below step.
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.
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.
For me there were 2 things I needed to do:
nvm install
as administratornvm use
Steps:
nvm install 14
nvm use 14.20.0
node -v
to verify it's using 14.20.0If 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".
For me deleting npm and npm-cache folder from AppData works
For me running nvm install 14.0.0 from PowerShell with admin rights did the job.
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
)
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)
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.