Node.js upgrade still shows older version in windows
Asked Answered
A

3

6

I have downloaded and installed the new version of nodejs (4.1.2) using the .msi installer. After that I ran node -v, but it still shows the older version (0.12.2). I tried restarting Windows and even uninstalled nodejs and reinstalled it, but still it shows the same. Why is that happening and how can I resolve it?

Adjoin answered 8/10, 2015 at 11:46 Comment(2)
You might want to check your path variable and make sure it is not pointing to an older version of node.jsLohman
Path variables are ok. I installed on the same directory.Adjoin
U
7

Run a search for multiple copies of node.exe in the usual install paths:

  • Program Files

      Get-ChildItem -File -path $env:PROGRAMFILES -include node.exe -recurse -force
    
  • Program Files(x86)

      Get-ChildItem -File -path $env:PROGRAMFILESX86 -include node.exe -recurse -force
    
  • Common Files

      Get-ChildItem -File -path $env:COMMONPROGRAMFILES -include node.exe -recurse -force
    
  • Roaming

      Get-ChildItem -File -path $env:APPDATA -include node.exe -recurse -force
    

Upgrading npm has its own issues:

Chances are that you attempted to upgrade npm before, it somehow failed, and you then went looking for this tool. If the tool fails to upgrade, it may be troubled by partial changes done during npm install npm or npm upgrade npm. In that case, you will have to completely uninstall Node:

Uninstall Node.js (select Uninstall, not the Repair option).

Go into %programfiles%\nodejs and delete the entire folder.

Delete %appdata%\npm and %appdata%\npm-cache.

Edit your PATH and remove everything that references npm (to do so, hit "Start" and search for "Environment Variables").

Reinstall Node, then install this tool - and only use this tool to upgrade npm, do not attempt to run npm install npm.

References

Uproot answered 9/9, 2016 at 8:35 Comment(2)
Well, I solved this problem long ago. The reason of this problem was indeed multiple existence of node.js installation.Adjoin
I had a similar issue, had two instances of node installed, so I removed one through Control Panel, other one, older version, I just deleted the folder. After this clean installation of new version works with no issues. Thx Paul.Mane
F
3

I had the same issue and resolved it by deleting the node.js folder in program files (x64) and it w

Forequarter answered 18/10, 2016 at 22:55 Comment(0)
C
0

I had remove Nsolid path from Environment. it should be relate to node.exe in different path, make sure Nsolid, %appdata%/npm dont have node.exe file.

Crelin answered 30/6, 2022 at 5:7 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.