Last active
May 18, 2019 07:07
-
-
Save CreatiCoding/e80b348936eb11d99054a62eca4e9253 to your computer and use it in GitHub Desktop.
[bash] install node 10 in ubuntu including about auth for npm directory.
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
sudo apt-get install -y curl | |
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash - | |
sudo apt-get install -y nodejs | |
OUTPUT="$(npm config get prefix)" | |
echo "$OUTPUT" | |
if [ "$OUTPUT" == "/usr/local" ]; then | |
OUTPUT="$(sudo chown -R $USER /usr/local)" | |
else | |
OUTPUT="$(mkdir ~/npm-global-modules)" | |
OUTPUT="$(npm config set prefix '~/npm-global-modules')" | |
OUTPUT="$(echo 'export PATH=~/npm-global-modules/bin:\'$PATH >> ~/.profile )" | |
OUTPUT="$(source ~/.profile)" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment