How to install multiple version of node.js in Ubuntu using NVM?
如何安装多个版本的节点。在Ubuntu中使用NVM的js ?
3 个解决方案
#1
71
prior knowledge
How to use the terminal. You can for example use gnome-terminal
.
如何使用终端。例如,可以使用gnome-terminal。
Install dependencies
sudo apt-get install build-essential libssl-dev curl git-core
Install NVM
Below we will install NVM.
下面我们将安装NVM。
Download nvm
git clone git://github.com/creationix/nvm.git ~/.nvm
To activate nvm, you need to source it from your bash shell
echo "\n. ~/.nvm/nvm.sh" >> .bashrc
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.
在本例中,我将安装节点v0.4.12。我们首先需要打开新的bash会话。您还可以通过再次输入bash来实现这一点。
$ bash
$ nvm install v0.4.12 #This takes a while.
To make the latest v0.4 branch default you do
要使最新的v0.4分支默认,您需要这样做
$ nvm alias default 0.4
Troubleshooting
When you don't have all dependencies installed you can not compile/install node.js. Then you will need to clean up ~/.nvm
如果没有安装所有依赖项,就不能编译/安装node.js。然后你需要清理~/.nvm。
$ rm -rf ~/.nvm/
#2
6
Here is a detailed, up-to-date manual: https://www.digitalocean.com/community/articles/how-to-install-node-js-with-nvm-node-version-manager-on-a-vps#installation
这里有一个详细的最新手册:https://www.digitalocean.com/community/articles/how-to-install-node-js-with-nvm-node-version-manager-on- vps#installation
#3
4
The top answer is out of date. Now, just follow the guide on the github to install :
上面的答案已经过时了。现在,按照github上的指南来安装:
https://github.com/creationix/nvm#installation
https://github.com/creationix/nvm安装
For linux machines, its as simple as :
对于linux机器,它简单到:
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh | bash
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh | bash
#1
71
prior knowledge
How to use the terminal. You can for example use gnome-terminal
.
如何使用终端。例如,可以使用gnome-terminal。
Install dependencies
sudo apt-get install build-essential libssl-dev curl git-core
Install NVM
Below we will install NVM.
下面我们将安装NVM。
Download nvm
git clone git://github.com/creationix/nvm.git ~/.nvm
To activate nvm, you need to source it from your bash shell
echo "\n. ~/.nvm/nvm.sh" >> .bashrc
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.
在本例中,我将安装节点v0.4.12。我们首先需要打开新的bash会话。您还可以通过再次输入bash来实现这一点。
$ bash
$ nvm install v0.4.12 #This takes a while.
To make the latest v0.4 branch default you do
要使最新的v0.4分支默认,您需要这样做
$ nvm alias default 0.4
Troubleshooting
When you don't have all dependencies installed you can not compile/install node.js. Then you will need to clean up ~/.nvm
如果没有安装所有依赖项,就不能编译/安装node.js。然后你需要清理~/.nvm。
$ rm -rf ~/.nvm/
#2
6
Here is a detailed, up-to-date manual: https://www.digitalocean.com/community/articles/how-to-install-node-js-with-nvm-node-version-manager-on-a-vps#installation
这里有一个详细的最新手册:https://www.digitalocean.com/community/articles/how-to-install-node-js-with-nvm-node-version-manager-on- vps#installation
#3
4
The top answer is out of date. Now, just follow the guide on the github to install :
上面的答案已经过时了。现在,按照github上的指南来安装:
https://github.com/creationix/nvm#installation
https://github.com/creationix/nvm安装
For linux machines, its as simple as :
对于linux机器,它简单到:
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh | bash
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh | bash