Browse Source

SCRIPT DEPRECATION WARNING Node JS install script

You don't want to wait 60 sec
Jaap Marcus 2 years ago
parent
commit
30ecb83d24
1 changed files with 7 additions and 1 deletions
  1. 7 1
      bin/v-update-sys-hestia-git

+ 7 - 1
bin/v-update-sys-hestia-git

@@ -20,6 +20,8 @@ source /etc/hestiacp/hestia.conf
 source $HESTIA/func/main.sh
 # load config file
 source_conf "$HESTIA/conf/hestia.conf"
+# define NodeJS version for download (required for building JS/CSS)
+NODE_MAJOR=20
 
 # Perform verification if read-only mode is enabled
 check_hestia_demo_mode
@@ -28,6 +30,10 @@ check_hestia_demo_mode
 if [ -z $(which "node") ]; then
 	read -p "NodeJS not found. Install now to proceed? [Y/n] " answer
 	if [ "$answer" = 'y' ] || [ "$answer" = 'Y' ]; then
+		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
+
+		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 install -y nodejs
 	else
 		exit 0
@@ -305,7 +311,7 @@ mkdir -p $BUILD_DIR_HESTIA/usr/local/hestia
 # Move needed directories
 cd $BUILD_DIR/hestiacp-$branch_dash
 
-npm ci
+npm install
 npm run build
 
 cp -rf bin func install web $BUILD_DIR_HESTIA/usr/local/hestia/