[英]Install multiple version of node.js using NVM (Ubuntu)
How to use the terminal. 如何使用终端。 You can for example use
gnome-terminal
. 例如,您可以使用
gnome-terminal
。
sudo apt-get install build-essential libssl-dev curl git-core
Below we will install NVM. 下面我们将安装NVM。
git clone git://github.com/creationix/nvm.git ~/.nvm
echo "\n. ~/.nvm/nvm.sh" >> .bashrc
In this example I am going to install node v0.4.12. 在此示例中,我将安装节点v0.4.12。 We first need open new bash session.
我们首先需要打开新的bash会话。 You can also do this by typing
bash
again. 您也可以通过再次输入
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
When you don't have all dependencies installed you can not compile/install node.js. 如果没有安装所有依赖项,则无法编译/安装node.js。 Then you will need to clean up ~/.nvm
然后您需要清理〜/ .nvm
$ rm -rf ~/.nvm/
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#installation
For linux machines, its as simple as : 对于linux机器,其操作非常简单:
curl -o- https://raw.githubusercontent.com/creationix/nvm/v*/install.sh | bash
Replace v*
with the latest version from https://github.com/creationix/nvm/releases . 将
v*
替换为https://github.com/creationix/nvm/releases中的最新版本。
For example: curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash
例如:
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash
sudo apt-get install build-essential checkinstall
sudo apt-get install build-essential checkinstall
sudo apt-get install libssl-dev
须藤apt-get install libssl-dev
curl -o- https://raw.githubusercontent.com/cre ... |
curl -o- https://raw.githubusercontent.com/cre ... | bash
重击
command -v nvm
命令-v nvm
nvm ls-remote
nvm ls-remote
nvm install 6.14.4
nvm安装6.14.4
nvm use 6.14.4
nvm使用6.14.4
nvm alias default node 6.14.4
nvm别名默认节点6.14.4
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.