如何从Windows完全删除node.js [英] How to completely remove node.js from Windows
问题描述
我卸载了先前版本的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:
-
深吸一口气.
-
运行
npm cache clean --force
-
从程序&卸载卸载程序的功能.
-
重新启动(或者您可能可以通过从任务管理器中杀死所有与节点相关的进程来摆脱困境).
-
查找这些文件夹,然后删除它们(及其内容)(如果仍然存在).取决于您安装的版本,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-*
-
-
检查您的
%PATH%
环境变量,以确保不存在对Nodejs
或npm
的引用. -
如果尚未卸载 still ,请在命令提示符下键入
where node
,您会看到它的驻留位置-还要删除该文件夹(可能还要删除其父目录). p>
-
重新启动,以防万一.
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:
Take a deep breath.
Run
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).
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-*
Check your
%PATH%
environment variable to ensure no references toNodejs
ornpm
exist.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.Reboot, for good measure.
这篇关于如何从Windows完全删除node.js的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!