Skip to content

Instantly share code, notes, and snippets.

@mdrmike
Created April 14, 2016 18:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mdrmike/f2e049798bfb0a2d3cb50a4edd0b45b1 to your computer and use it in GitHub Desktop.
Save mdrmike/f2e049798bfb0a2d3cb50a4edd0b45b1 to your computer and use it in GitHub Desktop.
Install Nodejs on Ubuntu 13.10+

How to install nodejs on Ubuntu 13.10+

Based on: • http://askubuntu.com/questions/507684/trying-to-install-yeoman-on-ubuntu-to-use-with-nodejs-and-npmhttp://stackoverflow.com/questions/16151018/npm-throws-error-without-sudo/24404451#24404451

First Uninstall node

sudo ls # prime sudo with use password 
sudo npm ls -gp | awk -F/ '/node_modules/ && !/node_modules.*node_modules/ {print $NF}' | sudo xargs npm -g rm
sudo apt-get --purge remove nodejs

manually fix any node environment PATH variable in ~/.bashrc ~/.bash_aliases ~/.profile &/or ~/.zshrc

Install NVM

manually install to ~/.nvm per: https://github.com/creationix/nvm

git clone https://github.com/creationix/nvm.git ~/.nvm && cd ~/.nvm && git checkout `git describe --abbrev=0 --tags`
. ~/.nvm/nvm.sh

Install Node using NVM

nvm install stable
#alternatively:  nvm install 4.4.3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment