使用NVM安装多个版本的node.js(Ubuntu) [英] Install multiple version of node.js using NVM (Ubuntu)
本文介绍了使用NVM安装多个版本的node.js(Ubuntu)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何使用 NVM 在Ubuntu中安装多个版本的node.js?
How to install multiple version of node.js in Ubuntu using NVM?
推荐答案
先验知识
如何使用终端.例如,您可以使用gnome-terminal
.
sudo apt-get install build-essential libssl-dev curl git-core
安装NVM
下面,我们将安装NVM.
Install NVM
Below we will install NVM.
git clone git://github.com/creationix/nvm.git ~/.nvm
要激活nvm,您需要从bash shell中获取它
echo "\n. ~/.nvm/nvm.sh" >> .bashrc
node.js的安装版本
在此示例中,我将安装节点v0.4.12.我们首先需要打开新的bash会话.您也可以再次输入bash
来完成此操作.
Install version of node.js
In this example I am going to install node v0.4.12. We first need open new bash session. You can also do this by typing bash
again.
$ bash
$ nvm install v0.4.12 #This takes a while.
要将默认的最新v0.4分支设置为
To make the latest v0.4 branch default you do
$ nvm alias default 0.4
问题排查
如果未安装所有依赖项,则无法编译/安装node.js.然后,您需要清理〜/.nvm
Troubleshooting
When you don't have all dependencies installed you can not compile/install node.js. Then you will need to clean up ~/.nvm
$ rm -rf ~/.nvm/
这篇关于使用NVM安装多个版本的node.js(Ubuntu)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文