Last active
March 10, 2020 18:56
-
-
Save agmm/80c58ca8114abd5d16259488a601fd4f to your computer and use it in GitHub Desktop.
Script to install N, Node and NPM in a Debian machine
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
# To run this script execute: | |
# curl -L https://gist.githubusercontent.com/agmm/80c58ca8114abd5d16259488a601fd4f/raw/1a016ca9e6e9281a57a931c6209ba41dc7ea27d7/debian-install-node.sh -o setup && sudo bash setup | |
echo -e "\n\nRemember to run with sudo" | |
# Exit if one of the commands fails | |
set -e | |
set -o pipefail | |
# Install Git | |
echo -e "\nInstalling Git" | |
apt-get install git | |
# Configure git credentials cache to last 1hr | |
echo -e "\nConfiguring Git cache time" | |
git config --global credential.helper 'cache --timeout=3600' | |
# Download and install the node manager named n | |
echo -e "\nDownloading node manager" | |
curl -L https://raw.githubusercontent.com/tj/n/master/bin/n -o n | |
echo -e "\nInstalling the latest version of Node" | |
bash n lts | |
# Echo the version of Node | |
echo -e "\nNode version" | |
node -v | |
# Echo the version of NPM | |
echo -e "\nNPM version" | |
npm -v |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment