简体   繁体   English

如何在Ubuntu 12.04上为Node.js安装NVM

[英]How to install the nvm for node.js on ubuntu 12.04

I try to install the nvm for my node.js . 我尝试为我的node.js安装nvm But I have to do export PYTHON=python2 . 但是我必须export PYTHON=python2

What is this and how does it work? 这是什么,它如何工作?

I use Ubuntu 12.04 in a virtualbox. 我在virtualbox中使用Ubuntu 12.04。 I can't get the nvm installed... more than two days this is keeping me awake... what did I do wrong? 我无法安装nvm ...超过两天,这让我保持清醒...我做错了什么?

You need to do export PYTHON=python2 only if python3 is set by default on your system. 仅当系统默认情况下设置了python3时,才需要export PYTHON=python2

First check the python version by running 首先通过运行检查python版本

> python --version
> Python 2.7.3

If it shows 3.xx then you should simply run this in this console before running installer eg. 如果显示3.xx,则应在运行安装程序之前先在此控制台中运行。

export PYTHON=python2

then run installer 然后运行安装程序

curl https://raw.github.com/creationix/nvm/master/install.sh | sh
#or
wget -qO- https://raw.github.com/creationix/nvm/master/install.sh | sh

See nvm docs link . 请参阅nvm docs 链接

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM