Install NodeJS via N (#50)

Hardcoded to v8.16
This commit is contained in:
Danp2 2019-05-09 09:37:04 -05:00 committed by GitHub
parent 70406d1191
commit 174d0df759
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -14,7 +14,6 @@ xo_branch="master"
xo_server="https://github.com/vatesfr/xen-orchestra"
n_repo="https://raw.githubusercontent.com/visionmedia/n/master/bin/n"
yarn_repo="deb https://dl.yarnpkg.com/debian/ stable main"
node_source="https://deb.nodesource.com/setup_8.x"
yarn_gpg="https://dl.yarnpkg.com/debian/pubkey.gpg"
n_location="/usr/local/bin/n"
xo_server_dir="/opt/xen-orchestra"
@ -25,19 +24,22 @@ xo_service="xo-server.service"
/usr/bin/apt-get update
/usr/bin/apt-get --yes install git curl
#Install node and yarn
#Install yarn
cd /opt
/usr/bin/curl -sL $node_source | bash -
/usr/bin/curl -sS $yarn_gpg | apt-key add -
echo "$yarn_repo" | tee /etc/apt/sources.list.d/yarn.list
/usr/bin/apt-get update
/usr/bin/apt-get install --yes nodejs yarn
/usr/bin/apt-get install --yes yarn
# Install n
/usr/bin/curl -o $n_location $n_repo
/bin/chmod +x $n_location
# Install node via n
n 8.16
# Symlink node directories
ln -s /usr/bin/node /usr/local/bin/node