2022-02-17 13:54:42 +01:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
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-16 19:09:53 +01:00
|
|
|
/usr/bin/curl -sL $SETUP_URL | /bin/bash -
|
|
|
|
/usr/bin/apt-get update && /usr/bin/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."
|