Skip to content

Instantly share code, notes, and snippets.

@kyeotic
Forked from isaacs/node-and-npm-in-30-seconds.sh
Last active January 8, 2016 18:07
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 kyeotic/7324aaa515ade384cb1c to your computer and use it in GitHub Desktop.
Save kyeotic/7324aaa515ade384cb1c to your computer and use it in GitHub Desktop.
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
#curl https://gist.githubusercontent.com/tyrsius/7324aaa515ade384cb1c/raw/927e4cd87d54a64c7a4ffc3b14739e5437346c35/node-and-npm-in-30-seconds.sh | sh
#echo 'export PATH=$PATH:$HOME/bin/node/bin' >> ~/.bashrc
. ~/.bashrc
mkdir bin -p
cd ~/bin
mkdir node -p
rm -rf install-node
mkdir install-node -p
cd install-node
curl https://nodejs.org/dist/v4.2.0/node-v4.2.0.tar.gz | tar xz --strip-components=1
./configure --prefix=~/bin/node
make install
curl https://raw.githubusercontent.com/npm/npm/master/scripts/install.sh | sh
cd ~/bin
rm -rf install-node
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment