Node.js 升级仍然显示 windows 中的旧版本

Node.js upgrade still shows older version in windows

我已经使用 .msi 安装程序下载并安装了新版本的 nodejs (4.1.2)。之后我 运行 node -v,但它仍然显示旧版本 (0.12.2)。我尝试重新启动 Windows 甚至卸载 nodejs 并重新安装它,但它仍然显示相同。为什么会发生这种情况,我该如何解决?

运行 在通常的安装路径中搜索 node.exe 的多个副本:

  • 程序文件

      Get-ChildItem -File -path $env:PROGRAMFILES -include node.exe -recurse -force
    
  • 程序文件(x86)

      Get-ChildItem -File -path $env:PROGRAMFILESX86 -include node.exe -recurse -force
    
  • 常用文件

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

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

升级 npm 有其自身的问题:

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.

参考资料

我遇到了同样的问题并通过删除程序文件 (x64) 中的 node.js 文件夹解决了这个问题,它 w