Skip to content

Instantly share code, notes, and snippets.

@mogetutu
Last active February 24, 2016 06:55
Show Gist options
  • Save mogetutu/25f8eaa3f253a53ca78d to your computer and use it in GitHub Desktop.
Save mogetutu/25f8eaa3f253a53ca78d to your computer and use it in GitHub Desktop.
Install NVM - Lastest Node & npm

Also, since nvm uses the name "node" instead of "nodejs", make sure that the unrelated program also named "node" -- the Amateur Packet Radio -- does not already exist on your system.

sudo apt-get install git build-essential libssl-dev curl git-core
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.23.3/install.sh | bash

(I determined the latest nvm version available -- and a lot of other, really helpful information -- at: https://github.com/creationix/nvm)

To have nvm automatically sourced, accessible at login:

vi ~/.bashrc

And add this to the end:

source ~/.nvm/nvm.sh

Now, as root (of course):

vi /etc/bash.bashrc

And add this to the end:

export NVM_SYMLINK_CURRENT=true

(close your terminal sessions and log back in - not as root)

nvm install stable
nvm use stable

To set a default version to be used in any new shell, use the alias 'default':

nvm alias default stable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment