-
Notifications
You must be signed in to change notification settings - Fork 65
/
installNodeJS.sh
49 lines (29 loc) · 1020 Bytes
/
installNodeJS.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash
# install NTP just incase:
# - NodeJS throws an error if you try to compile with a server date before the NodeJS release date
#source <(curl -s https://raw.github.com/qrpike/CentOS-6-Quick-Install-Scripts/master/installNTP.sh --insecure)
# CHANGE THIS URL FOR DIFF VERSIONS :::
# -----------------------------------------------------
JSURL=http://nodejs.org/dist/node-latest.tar.gz
# -----------------------------------------------------
clear
echo 'We are going to install NodeJS for you... '
echo 'checking if we got wget magic'
yum install -y wget #check if we have it
echo 'lets download nodejs..'
rm -r -f /usr/local/src
mkdir -p /usr/local/src
cd /usr/local/src
wget $JSURL
tar -zxvf ./node-latest.tar.gz
echo 'Files extracted....'
cd node-v*
yum install -y openssl-devel gcc-c++ make git
echo 'Configuring and installing NodeJS'
./configure
make
make install
echo 'welllllll....... that should be it.... hopefully :)'
clear
echo "Node is now installed @ version:"
node --version