Skip to content

Instantly share code, notes, and snippets.

@JJ
Forked from isaacs/node-and-npm-in-30-seconds.sh
Last active January 3, 2016 11:59
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 JJ/8459799 to your computer and use it in GitHub Desktop.
Save JJ/8459799 to your computer and use it in GitHub Desktop.
Installing node in a very raw box (like the one provided by docker). It will take a bit more than 30 seconds, somehow
#Problem with this is that it needs lots of installed stuff, so I'll put it here
# sudo or admin shell is presupposed
apt-get install make curl python-setuptools gcc g++
#Maybe you can safely supress make and gcc from here, since they are dependencies of g++
#Then you can proceed to the original set
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir /usr/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=/usr/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://npmjs.org/install.sh | sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment