使用 nvm 卸载当前活动的 node.js 版本 [英] Uninstalling the currently active version of node.js with nvm

查看:299
本文介绍了使用 nvm 卸载当前活动的 node.js 版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 Ubuntu 16.04 上,我错误地使用 root 安装 nvm,然后通过 nvm 安装 node.js 8.8.1.我还使用了 nvm alias default 8.8.1,认为它会纠正我的错误.

On Ubuntu 16.04, I mistakenly used root to install nvm, and then to install node.js 8.8.1 via nvm. I also used nvm alias default 8.8.1, thinking it would correct my error.

现在我想:

  1. 删除默认别名
  2. 卸载节点 8.8.1
  3. 卸载 node 附带的 npm 4.8.5
  4. 卸载 nvm
  5. 为正确的非 sudo 用户正确重新安装所有内容

看起来我已经成功完成了第一部分:

It looks like I've succeeded with the first part:

# nvm unalias default
Deleted alias default - restore it with `nvm alias "default" "8.8.1"`

但是nvm拒绝卸载节点8.8.1,因为它是唯一安装的版本:

But nvm refuses to uninstall node 8.8.1, because it is the only version installed:

# nvm uninstall 8.8.1                                                                                                                             
nvm: Cannot uninstall currently-active node version, v8.8.1 (inferred from 8.8.1).

我猜我首先需要停用节点 8.8.1,但我在 nvm --help 的输出中看不到任何可能会执行此操作的内容.

I am guessing that I first need to disactivate node 8.8.1, but I see nothing in the output of nvm --help which would appear to do this.

在正确重新安装所有内容之前,我需要采取哪些步骤才能从机器中完全删除 node.js、npm 和 nvm?

What steps do I need to take to completely remove node.js, npm and nvm from the machine before re-installing everything correctly?

推荐答案

第一类

$ nvm deactivate

然后输入

$ nvm uninstall 8.8.1

这篇关于使用 nvm 卸载当前活动的 node.js 版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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