Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I try to install the nvm for my node.js. But I have to do export PYTHON=python2.

What is this and how does it work?

I use Ubuntu 12.04 in a virtualbox. I can't get the nvm installed... more than two days this is keeping me awake... what did I do wrong?

like image 687
MoniqueL Avatar asked May 03 '13 20:05

MoniqueL


People also ask

Can I install NVM with Node already installed?

You can install and use NVM regardless of whether you have installed Node already. NVM alters path variables to select different versions of Node, so it works with pre-existing installations. Install NVM using either curl or wget .


1 Answers

You need to do export PYTHON=python2 only if python3 is set by default on your system.

First check the python version by running

> python --version
> Python 2.7.3

If it shows 3.x.x then you should simply run this in this console before running installer eg.

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.

like image 140
user568109 Avatar answered Sep 18 '22 22:09

user568109