Merge pull request #2567 from solgenomics/topic/update_docs
[sgn.git] / js / install_node.sh
blob8ab1815a03fbb4fe3c9595cb2f27b81cb6b05a8c
1 #!/usr/bin/env bash
3 if [[ $(/usr/bin/id -u) -ne 0 ]]; then
4 echo "\nMust run script as root."
5 exit
6 fi
8 # Add the NodeSource package signing key
9 curl -sSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add -
11 # Add the desired NodeSource repository
12 VERSION=node_10.x
13 # The below command will set this correctly, but if lsb_release isn't available, you can set it manually:
14 # - For Debian distributions: jessie, sid, etc...
15 # - For Ubuntu distributions: xenial, bionic, etc...
16 DISTRO="$(lsb_release -s -c)"
17 echo "deb https://deb.nodesource.com/$VERSION $DISTRO main" | tee /etc/apt/sources.list.d/nodesource.list
18 echo "deb-src https://deb.nodesource.com/$VERSION $DISTRO main" | tee -a /etc/apt/sources.list.d/nodesource.list
20 # Update package lists and install Node.js
21 apt-get update
22 apt-get install nodejs