update node.js installation method

node-20
Moe 2023-09-05 11:00:47 -07:00
parent 00a387a803
commit ba42ac2cd8
9 changed files with 18 additions and 27 deletions

View File

@ -85,8 +85,7 @@ echo "========================================================="
#Check if Node.js is installed
if ! [ -x "$(command -v node)" ]; then
echo "Node.js not found, installing..."
sudo curl --silent --location https://rpm.nodesource.com/setup_16.x | sudo bash -
sudo "$pkgmgr" install nodejs -y -q -e 0
sh nodejs-redhat.sh
else
echo "Node.js is already installed..."
echo "Version: $(node -v)"

2
INSTALL/nodejs-redhat.sh Normal file
View File

@ -0,0 +1,2 @@
sudo yum install --nogpgcheck https://rpm.nodesource.com/pub_16.x/nodistro/repo/nodesource-release-nodistro-1.noarch.rpm -y
sudo yum install --nogpgcheck nodejs -y

8
INSTALL/nodejs-ubuntu.sh Normal file
View File

@ -0,0 +1,8 @@
sudo apt-get update
sudo apt-get install -y ca-certificates curl gnupg
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
NODE_MAJOR=16
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list
sudo apt-get update
sudo apt-get install nodejs -y

View File

@ -6,7 +6,7 @@ echo "If your OS is not on the list please refer to the docs."
echo "========"
echo "1. Ubuntu - Fast and Touchless"
echo "2. Ubuntu - Advanced"
echo "3. Rocky 9 / CentOS 8 - Fast and Touchless"
echo "3. Alma Linux 9.2 / Rocky 9 / CentOS 8 - Fast and Touchless (Red Hat)"
echo "4. CentOS"
echo "5. MacOS"
echo "6. FreeBSD"

View File

@ -44,8 +44,7 @@ echo "========================================================="
#Check if Node.js is installed
if ! [ -x "$(command -v node)" ]; then
echo "Node.js not found, installing..."
sudo curl --silent --location https://rpm.nodesource.com/setup_16.x | sudo bash -
sudo yum install nodejs -y -q -e 0
sh nodejs-redhat.sh
else
echo "Node.js is already installed..."
echo "Version: $(node -v)"
@ -93,6 +92,7 @@ sudo npm install pm2@latest -g
sudo chmod -R 755 .
touch INSTALL/installed.txt
dos2unix INSTALL/shinobi
chmod +x INSTALL/shinobi
ln -s INSTALL/shinobi /usr/bin/shinobi
echo "========================================================="

View File

@ -3,11 +3,7 @@ echo "Shinobi - Do you want to Install Node.js?"
echo "(y)es or (N)o"
read -r nodejsinstall
if [ "$nodejsinstall" = "y" ]; then
wget https://deb.nodesource.com/setup_12.x
chmod +x setup_12.x
./setup_12.x
sudo apt install nodejs -y
rm setup_12.x
sh nodejs-ubuntu.sh
fi
#Detect Ubuntu Version

View File

@ -51,12 +51,7 @@ fi
if ! [ -x "$(command -v node)" ]; then
echo "============="
echo "Shinobi - Installing Node.js"
wget https://deb.nodesource.com/setup_12.x
chmod +x setup_12.x
./setup_12.x
sudo apt install nodejs -y
sudo apt install node-pre-gyp -y
rm setup_12.x
sh nodejs-ubuntu.sh
else
echo "Node.js Found..."
echo "Version : $(node -v)"

View File

@ -55,12 +55,7 @@ if ! [ -x "$(command -v ifconfig)" ]; then
fi
echo "============="
echo "Shinobi - Installing Node.js"
wget https://deb.nodesource.com/setup_16.x
chmod +x setup_16.x
./setup_16.x
sudo apt install nodejs -y
sudo apt install node-pre-gyp -y
rm setup_16.x
sh nodejs-ubuntu.sh
if ! [ -x "$(command -v npm)" ]; then
sudo apt install npm -y
fi

View File

@ -47,11 +47,7 @@ fi
if ! [ -x "$(command -v node)" ]; then
echo "============="
echo "Shinobi - Installing Node.js"
wget https://deb.nodesource.com/setup_16.x
chmod +x setup_16.x
./setup_16.x
sudo apt install nodejs -y
rm setup_16.x
sh nodejs-ubuntu.sh
else
echo "Node.js Found..."
echo "Version : $(node -v)"