File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+
3
+ YUM_CMD=$( which yum) # yum package manager for RHEL & CentOS
4
+ DNF_CMD=$( which dnf) # dnf package manager for new RHEL & CentOS
5
+ APT_GET_CMD=$( which apt-get) # apt package manager for Ubuntu & other Debian based distributions
6
+ APK_CMD=$( which apk) # apk package manager for Alpine
7
+
8
+ if [ ! -z $APT_GET_CMD ]; then
9
+ if [ -n " $( uname -a | grep Ubuntu) " ]; then
10
+ curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
11
+ sudo apt-get install -y nodejs
12
+ else
13
+ curl -sL https://deb.nodesource.com/setup_12.x | bash -
14
+ sudo apt-get install -y nodejs
15
+ fi
16
+ elif [ ! -z $DNF_CMD ]; then
17
+ sudo dnf install -y gcc-c++ make
18
+ curl -sL https://rpm.nodesource.com/setup_12.x | sudo -E bash -
19
+ sudo dnf install nodejs
20
+ elif [ ! -z $YUM_CMD ]; then
21
+ sudo yum install nodejs12
22
+ elif [ 1 -z $APK_CMD ]; then
23
+ sudo apk update
24
+ sudo apk add nodejs
25
+ else
26
+ echo " Couldn't install package"
27
+ exit 1;
28
+ fi
29
+
30
+ node --version
You can’t perform that action at this time.
0 commit comments