6

I have Node.js installed in my machine with Windows 10. However, I found something weird with Node.js.

When doing node -v from the command line, I got the running version as 0.10.28, but I am sure I have upgraded Node.js by downloading Node.js from the Node.js site on which the version is 4.4.7.

So I tried to uninstall Node.js from the Apps and Features. Node.js was removed, but through command line, I am still able to do node -v and return the same version. I tried to restart the machine, and it is still the same.

How can I solve this?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Joseph Goh
  • 689
  • 5
  • 16
  • 38

2 Answers2

21

Try look for these folders and remove them (and their contents) if any still exist. Depending on the version you installed, UAC settings, and CPU architecture, these may or may not exist:

  • C:\Program Files (x86)\Nodejs
  • C:\Program Files\Nodejs
  • C:\Users\{User}\AppData\Roaming\npm (or %appdata%\npm)
  • C:\Users\{User}\AppData\Roaming\npm-cache (or %appdata%\npm-cache)

Check your %PATH% environment variable to ensure no references to Node.js or npm exist.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
mosesmeirelles
  • 427
  • 3
  • 7
  • there is one folder reside in `C:\Program Files\Nodejs`, thanks for your help – Joseph Goh Jul 27 '16 at 02:46
  • You're welcome, I got same problem on my Linux, so I understand your feeling about that. – mosesmeirelles Jul 27 '16 at 02:47
  • just wonder why the new downloaded node is installed in `C:\Program Files (x86)\Nodejs` instead in `C:\Program Files\Nodejs` while the installer is for `x64`? – Joseph Goh Jul 27 '16 at 02:48
  • According this [issue](https://github.com/nodejs/node/issues/2951) it's a conflict about the older version installation – mosesmeirelles Jul 27 '16 at 02:52
  • I also had to run MicrosoftProgram_Install_and_Uninstall to fix the nodejs installation - https://support.microsoft.com/en-us/help/17588/fix-problems-that-block-programs-from-being-installed-or-removed – tkit Jul 22 '17 at 16:27
2

I guess you have multiple Node.js installations on your system. You should run echo %PATH% to see, which is the first Node.js path.

To prove my guess, you can just go to the 4.4.7 installation folder and then run node -v to see the version number. I'm positive you will get 4.4.7.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
stanleyxu2005
  • 8,081
  • 14
  • 59
  • 94
  • there is one folder reside in `C:\Program Files\Nodejs`, just wonder how can i end up with 2 installation, and why did the new version of node that i downloaded from nodejs installed in `C:\Program Files (x86)\Nodejs` instead in `C:\Program Files\Nodejs` ? – Joseph Goh Jul 27 '16 at 02:47
  • Hum... You have both 32bit and 64bit installations. No matter how they came, you can first uninstall nodejs from control panel and then remove both directories, if any of them exists. And then run a clean install. – stanleyxu2005 Jul 27 '16 at 03:01