如何从Ubuntu删除节点版本0.12?

为了获得和声function,我安装了节点js 0.12。 但是现在在我的项目开发中,我使用nvm,以便可以有多个节点版本。 我已经使默认版本为0.10.34。 所以每当我input这个命令:

node --version 

我得到的版本为0.10.34。 这可以。

但是在安装像node-inspector这样的软件包时,下面的警告即将到来,我的debugging器在安装时不能正常工作。

 engine xmlbuilder@2.2.1: wanted: {"node":"0.8.x || 0.10.x"} (current: {"node":"0.12.3","npm":"2.9.1"}) 

debugging器给出如下错误:

 Error: Cannot find module '/usr/lib/node_modules/node-inspector/node_modules/v8-debug/build/debug/v0.4.4/node-v11-linux-x64/debug.node' Runtime.getProperties failed. ReferenceError: frame_index is not defined 

根据npm安装程序,版本仍然是0.12。 我search了很多,删除这个版本,但找不到任何工作的解决scheme。

执行

 sudo apt-get remove nodejs 

卸载nodejs的0.12.x版本。 如果你的经验是像我的Ubuntu 14.04,那也卸载npm。

您使用curl的脚本添加了文件/etc/apt/sources.list.d/nodesource.list

删除该文件

 sudo rm /etc/apt/sources.list.d/nodesource.list 

然后执行

 sudo apt-get install nodejs 

它将安装节点0.10.x.

如果打算打字,您还需要重新创build软链接

节点

从命令行。

 ln -s /usr/bin/nodejs /usr/bin/node 

最后重新安装npm

 sudo apt-get install npm 

我会完全删除node和npm,然后用https://github.com/creationix/nvm安装一个新版本。 使用nvm,您可以轻松pipe理多个节点版本。

还有其他的select来pipe理像https://github.com/tj/n或nave这样的节点版本