如何完全卸载Node.js,然后从头开始重新安装(Mac OS X)

偶尔善良 提交于 2020-08-06 19:53:48

问题:

My version of node is always v0.6.1-pre even after I install brew node and NVM install v0.6.19. 我的节点版本始终是v0.6.1-pre,即使我安装了brew节点并且NVM也安装了v0.6.19。

My node version is: 我的节点版本是:

node -v
v0.6.1-pre

NVM says this (after I install a version of node for the first time in one bash terminal): NVM这样说(我在一个bash终端中第一次安装了一个版本的节点之后):

nvm ls
v0.6.19
current:    v0.6.19

But when I restart bash, this is what I see: 但是当我重新启动bash时,这是我看到的:

nvm ls
v0.6.19
current:    v0.6.1-pre
default -> 0.6.19 (-> v0.6.19)

So where is this phantom node 0.6.1-pre version and how can I get rid of it? 那么这个幻影节点0.6.1-pre版本在哪里,我该如何摆脱它? I'm trying to install libraries via NPM so that I can work on a project. 我正在尝试通过NPM安装库,以便可以在项目上工作。

I tried using BREW to update before NVM, using "brew update" and "brew install node". 我尝试使用BREW在NVM之前进行更新,使用“ brew update”和“ brew install node”。 I've tried deleting the "node" directory in my /usr/local/include and the "node" and "node_modules" in my "/usr/local/lib". 我尝试删除/ usr / local / include中的“节点”目录以及“ / usr / local / lib”中的“节点”和“ node_modules”。 I've tried uninstalling npm and reinstalling it following these instructions. 我已尝试按照以下说明卸载npm并重新安装。

All of this because I was trying to update an older version of node to install the "zipstream" library. 所有这些都是因为我试图更新节点的旧版本以安装“ zipstream”库。 Now there's folders in my users directory, and the node version STILL isn't up to date, even though NVM says it's using 0.6.19. 现在,我的用户目录中有文件夹,并且节点版本STILL不是最新的,即使NVM表示它正在使用0.6.19。

Ideally, I'd like to uninstall nodejs, npm, and nvm, and just reinstall the entire thing from scratch on my system. 理想情况下,我想卸载nodejs,npm和nvm,然后从头开始重新安装整个系统。


解决方案:

参考一: https://stackoom.com/question/ktta/如何完全卸载Node-js-然后从头开始重新安装-Mac-OS-X
参考二: https://oldbug.net/q/ktta/How-do-I-completely-uninstall-Node-js-and-reinstall-from-beginning-Mac-OS-X
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!