Last active
August 4, 2016 16:07
-
-
Save IOAyman/8ca8e7aff15032a4e57af5606c47f142 to your computer and use it in GitHub Desktop.
install node
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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