Skip to content

Instantly share code, notes, and snippets.

@johhansantana
Last active January 29, 2016 13:20
Show Gist options
  • Save johhansantana/46c9bb977d5775df1516 to your computer and use it in GitHub Desktop.
Save johhansantana/46c9bb977d5775df1516 to your computer and use it in GitHub Desktop.
install node and npm
vim ~/.bashrc
make sure in your bashrc file you have the following:
export PATH=$HOME/local/bin:$PATH
export PATH="$PATH:$HOME/npm/bin"
# this one is optional, add it it doesn't work at the end
export NODE_PATH="$NODE_PATH:$HOME/npm/lib/node_modules"
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local or ./configure --prefix=$HOME/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl -L https://www.npmjs.com/install.sh | sh
#source https://gist.github.com/isaacs/579814 and http://stackoverflow.com/questions/31025159/installing-nodejs-without-sudo-in-ubuntu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment