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

查看:287
本文介绍了如何从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位.

解决方案

如何从Windows中删除Node.js:

  1. 深吸一口气.

  2. 运行npm cache clean --force

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

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

  5. 查找这些文件夹,然后删除它们(及其内容)(如果仍然存在).取决于您安装的版本,UAC设置和CPU体系结构,这些可能存在或可能不存在:

    • C:\Program Files (x86)\Nodejs
    • C:\Program Files\Nodejs
    • C:\Users\{User}\AppData\Roaming\npm(或%appdata%\npm)
    • C:\Users\{User}\AppData\Roaming\npm-cache(或%appdata%\npm-cache)
    • C:\Users\{User}\.npmrc(并且可能也检查没有.前缀的情况)
    • C:\Users\{User}\AppData\Local\Temp\npm-*
  6. 检查您的%PATH%环境变量,以确保不存在对Nodejsnpm的引用.

  7. 如果尚未卸载 still ,请在命令提示符下键入where node,您会看到它的驻留位置-还要删除该文件夹(可能还要删除其父目录).

  8. p>
  9. 重新启动,以防万一.

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.

解决方案

How to remove Node.js from Windows:

  1. Take a deep breath.

  2. Run npm cache clean --force

  3. Uninstall from Programs & Features with the uninstaller.

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

  5. 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)
    • C:\Users\{User}\.npmrc (and possibly check for that without the . prefix too)
    • C:\Users\{User}\AppData\Local\Temp\npm-*
  6. Check your %PATH% environment variable to ensure no references to Nodejs or npm exist.

  7. 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.

  8. Reboot, for good measure.

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

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