Skip to content

Instantly share code, notes, and snippets.

@randwa1k
Forked from isaacs/node-and-npm-in-30-seconds.sh
Last active March 20, 2018 16:53
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save randwa1k/9061221 to your computer and use it in GitHub Desktop.
Save randwa1k/9061221 to your computer and use it in GitHub Desktop.
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
make install # this steps takes many minutes
# curl https://npmjs.org/install.sh | sh
# use this below instead to avoid install.sh newline error
curl -O https://www.npmjs.org/install.sh
# avoid this error: find: `/usr/local/lib/node': No such file or directory
sudo mkdir -p /usr/local/{lib/node,include/node}
sudo sh install.sh
Output of last command:
tar=/bin/tar
version:
tar (GNU tar) 1.26
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by John Gilmore and Jay Fenlason.
install npm@latest
fetching: http://registry.npmjs.org/npm/-/npm-1.4.3.tgz
0.10.25
1.4.3
cleanup prefix=/usr/local
All clean!
/home/ubuntu/.node/bin/npm -> /home/ubuntu/.node/lib/node_modules/npm/bin/npm-cli.js
npm@1.4.3 /home/ubuntu/.node/lib/node_modules/npm
It worked
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment