this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: enhance install script to include Node.js installation from NodeSource and update dependency installation

+65 -8
-1
.gitignore
··· 17 17 # Dependencies 18 18 node_modules/ 19 19 stagehanderror.txt 20 - queue/alert-state.json
+65 -7
install.sh
··· 44 44 return 0 45 45 } 46 46 47 + # Function to install Node.js from official NodeSource repository 48 + install_nodejs() { 49 + print_message "Installing Node.js from NodeSource..." 50 + 51 + case $DISTRO in 52 + "ubuntu"|"debian"|"linuxmint") 53 + print_message "Setting up NodeSource repository for Ubuntu/Debian..." 54 + # Remove old Node.js versions and repositories 55 + sudo apt remove -y nodejs npm 2>/dev/null || true 56 + 57 + # Download and run NodeSource setup script for Node.js LTS (20.x) 58 + curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash - 59 + 60 + # Install Node.js 61 + sudo apt install -y nodejs 62 + ;; 63 + "fedora") 64 + print_message "Setting up NodeSource repository for Fedora..." 65 + # Remove old Node.js versions 66 + sudo dnf remove -y nodejs npm 2>/dev/null || true 67 + 68 + # Download and run NodeSource setup script for Node.js LTS 69 + curl -fsSL https://rpm.nodesource.com/setup_lts.x | sudo bash - 70 + 71 + # Install Node.js 72 + sudo dnf install -y nodejs 73 + ;; 74 + "arch"|"manjaro") 75 + print_message "Installing Node.js for Arch Linux..." 76 + # Arch repos typically have recent Node.js versions 77 + sudo pacman -Sy --noconfirm nodejs npm 78 + ;; 79 + *) 80 + print_error "Unsupported distribution for automatic Node.js installation." 81 + print_message "Please install Node.js manually from https://nodejs.org/" 82 + return 1 83 + ;; 84 + esac 85 + 86 + # Verify Node.js installation 87 + if command -v node >/dev/null 2>&1; then 88 + NODE_VERSION=$(node --version) 89 + print_success "Node.js installed successfully: $NODE_VERSION" 90 + else 91 + print_error "Node.js installation failed" 92 + return 1 93 + fi 94 + 95 + return 0 96 + } 97 + 47 98 # Function to install dependencies based on the Linux distribution 48 99 install_dependencies() { 49 100 print_message "Installing dependencies..." 50 101 51 102 case $DISTRO in 52 103 "ubuntu"|"debian"|"linuxmint") 53 - print_message "Installing for Ubuntu/Debian..." 104 + print_message "Installing base dependencies for Ubuntu/Debian..." 54 105 sudo apt update 55 - sudo apt install -y git nodejs npm ffmpeg 106 + sudo apt install -y git curl ffmpeg 56 107 ;; 57 108 "fedora") 58 - print_message "Installing for Fedora..." 109 + print_message "Installing base dependencies for Fedora..." 59 110 sudo dnf update -y 60 - sudo dnf install -y git nodejs npm ffmpeg 111 + sudo dnf install -y git curl ffmpeg 61 112 ;; 62 113 "arch"|"manjaro") 63 - print_message "Installing for Arch Linux..." 64 - sudo pacman -Sy --noconfirm git nodejs npm ffmpeg 114 + print_message "Installing base dependencies for Arch Linux..." 115 + sudo pacman -Sy --noconfirm git curl ffmpeg 65 116 ;; 66 117 *) 67 - print_error "Unsupported distribution. Please install the following manually: git, nodejs, npm, ffmpeg" 118 + print_error "Unsupported distribution. Please install the following manually: git, curl, ffmpeg" 68 119 return 1 69 120 ;; 70 121 esac 122 + 123 + # Install Node.js from NodeSource 124 + install_nodejs 125 + if [ $? -ne 0 ]; then 126 + print_error "Failed to install Node.js" 127 + return 1 128 + fi 71 129 72 130 # Install PM2 globally 73 131 print_message "Installing PM2 process manager..."