Last active
January 30, 2018 14:45
-
-
Save bma73/2e8a6625c3b3419eca1c to your computer and use it in GitHub Desktop.
Download and install NodeJS Package (Ubuntu)
This file contains hidden or 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
| #!/bin/bash | |
| FILE=/tmp/nodejs.download | |
| TARGET=/etc/nodejs/ | |
| LINK_NODE=/usr/bin/node | |
| LINK_NPM=/usr/bin/npm | |
| echo "Downloading $1" | |
| sudo wget $1 -O $FILE | |
| sudo tar xfm $FILE -C $TARGET | |
| FOLDER=$(ls -t $TARGET | head -1) | |
| sudo rm $LINK_NODE | |
| sudo rm $LINK_NPM | |
| sudo ln /etc/nodejs/$FOLDER/bin/node $LINK_NODE | |
| sudo ln -s /etc/nodejs/$FOLDER/bin/npm $LINK_NPM | |
| node --version | |
| exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment