2022-03-17 10:14:08 +01:00
|
|
|
#!/bin/bash
|
2022-02-17 13:54:42 +01:00
|
|
|
|
2022-03-23 08:33:44 +01:00
|
|
|
PATH="/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/scripts"
|
2022-03-23 08:16:01 +01:00
|
|
|
|
2022-03-01 13:55:05 +01:00
|
|
|
# abort if not executed as root
|
2022-02-17 13:54:42 +01:00
|
|
|
if [[ $(id -u) != "0" ]]; then
|
2022-02-25 16:33:46 +01:00
|
|
|
echo "Usage: run ${0##*/} as root" 1>&2
|
2022-02-17 13:54:42 +01:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2022-02-19 15:32:52 +01:00
|
|
|
set -e
|
|
|
|
|
|
|
|
SETUP_URL="https://deb.nodesource.com/setup_16.x"
|
|
|
|
|
|
|
|
echo "Installing NodeJS and NPM from \"$SETUP_URL\"..."
|
|
|
|
|
2022-03-23 08:16:01 +01:00
|
|
|
curl -sL $SETUP_URL | bash -
|
|
|
|
apt-get update && apt-get -qq install nodejs
|
2022-02-23 12:10:34 +01:00
|
|
|
npm install --unsafe-perm=true --allow-root -g npm testcafe
|
2022-02-17 13:54:42 +01:00
|
|
|
npm config set cache ~/.cache/npm
|
2022-02-19 15:32:52 +01:00
|
|
|
|
|
|
|
echo "Done."
|