如何从 Windows 中完全删除 node.js [英] How to completely remove node.js from Windows

查看:26
本文介绍了如何从 Windows 中完全删除 node.js的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我卸载了之前版本的 node.js (0.8.11) 并从 node.js 网站下载了最新的 0.10.24 并安装了它.但是,在运行 node --version 后,它仍然表明我正在运行 v0.8.11.显然,在卸载过程中留下了一些东西,这导致我在尝试通过 npm 添加模块时出现各种错误.我已经看到了针对 OSX 和 Linux 的解决方案,但找不到任何适用于 Windows 的解决方案.我运行的是 Windows 7 64 位.

I uninstalled my previous version of node.js (0.8.11) and downloaded the latest, 0.10.24 from the node.js website and installed it. However, after running node --version, it still indicates that I'm running v0.8.11. Obviously, some stuff was left behind during the uninstall process, and it's causing me to have all sorts of errors when trying to add modules through npm. I've seen solutions to this for OSX and Linux, but couldn't find anything for Windows. I'm running Windows 7 64-bit.

推荐答案

如何从 Windows 中删除 Node.js:

  1. 深呼吸.

  1. Take a deep breath.

运行 npm cache clean --force

从程序中卸载 &卸载程序的功能.

Uninstall from Programs & Features with the uninstaller.

重新启动(或者您可能可以从任务管理器中杀死所有与节点相关的进程).

Reboot (or you probably can get away with killing all node-related processes from Task Manager).

查找这些文件夹并删除它们(及其内容)(如果仍然存在).根据您安装的版本、UAC 设置和 CPU 架构,这些可能存在也可能不存在:

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 FilesNodejs
  • C:Users{User}AppDataRoaming pm(或 %appdata% pm)
  • C:Users{User}AppDataRoaming pm-cache(或 %appdata% pm-cache)
  • C:Users{User}.npmrc(也可能检查没有 . 前缀)
  • C:Users{User}AppDataLocalTemp pm-*
    • C:Program Files (x86)Nodejs
    • C:Program FilesNodejs
    • C:Users{User}AppDataRoaming pm (or %appdata% pm)
    • C:Users{User}AppDataRoaming pm-cache (or %appdata% pm-cache)
    • C:Users{User}.npmrc (and possibly check for that without the . prefix too)
    • C:Users{User}AppDataLocalTemp pm-*
      1. 检查您的%PATH% 环境变量 以确保不存在对 Nodejsnpm 的引用.

      1. Check your %PATH% environment variable to ensure no references to Nodejs or npm exist.

      如果它仍然没有卸载,在命令提示符下输入where node,你会看到它所在的位置——删除它(可能还有父节点)目录).

      If it's still not uninstalled, type where node at the command prompt and you'll see where it resides -- delete that (and probably the parent directory) too.

      重新启动,很好.

      这篇关于如何从 Windows 中完全删除 node.js的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆