Skip to content

Instantly share code, notes, and snippets.

@IOAyman
Last active August 4, 2016 16:07
Show Gist options
  • Save IOAyman/8ca8e7aff15032a4e57af5606c47f142 to your computer and use it in GitHub Desktop.
Save IOAyman/8ca8e7aff15032a4e57af5606c47f142 to your computer and use it in GitHub Desktop.
install node
#!/usr/bin/env bash
export install_dir=$HOME/.bin/nodejs
cd
mkdir -p $HOME/.bin
pushd $HOME/.bin
curl -sSLo pkg.tar.xz https://nodejs.org/dist/v6.3.1/node-v6.3.1-linux-x64.tar.xz
tar xvf pkg.tar.xz
mv node-v6.3.1-linux-x64 $install_dir
popd
cat >> $HOME/.bashrc << EOC
export PATH=$PATH:$install_dir/bin && \
export NPM_MODULES=$install_dir/lib/node_modules && \
export NODE_PATH=$install_dir:$NPM_MODULES
EOC
. $HOME/.bashrc
node -v
npm -v
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment