File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ GREEN='\033[0;32m'
77BLUE=' \033[0;34m'
88NC=' \033[0m'
99
10- VERSION=" 1.4.3 "
10+ VERSION=" 1.4.4 "
1111DIST_DIR=" dist"
1212ARCHIVE_NAME=" shipnode-payload.tar.gz"
1313INSTALLER_NAME=" shipnode-installer.sh"
@@ -90,7 +90,7 @@ YELLOW='\033[1;33m'
9090BLUE='\033[0;34m'
9191NC='\033[0m'
9292
93- VERSION="1.4.3 "
93+ VERSION="1.4.4 "
9494INSTALL_DIR="$HOME/.shipnode"
9595
9696# Parse flags
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ BLUE='\033[0;34m'
1010NC=' \033[0m'
1111
1212echo -e " ${BLUE} ╔════════════════════════════════════╗${NC} "
13- echo -e " ${BLUE} ║ ShipNode Installer v1.4.3 ║${NC} "
13+ echo -e " ${BLUE} ║ ShipNode Installer v1.4.4 ║${NC} "
1414echo -e " ${BLUE} ╚════════════════════════════════════╝${NC} "
1515echo
1616
Original file line number Diff line number Diff line change @@ -46,13 +46,32 @@ cmd_setup() {
4646 echo "jq already installed: $(jq --version)"
4747 fi
4848
49- # Install Node.js (using NodeSource)
49+ install_node=false
5050 if ! command -v node &> /dev/null; then
51- echo "Installing Node.js $NODE_VERSION..."
51+ install_node=true
52+ else
53+ CURRENT_NODE_MAJOR=$(node --version | sed -E 's/^v([0-9]+).*/\1/')
54+ if [ "$CURRENT_NODE_MAJOR" != "$NODE_VERSION" ]; then
55+ echo "Node.js $(node --version) found, but v$NODE_VERSION.x is configured."
56+ install_node=true
57+ elif ! command -v npm &> /dev/null; then
58+ echo "Node.js $(node --version) found, but npm is missing."
59+ install_node=true
60+ else
61+ echo "Node.js already installed: $(node --version)"
62+ fi
63+ fi
64+
65+ # Install Node.js (using NodeSource)
66+ if [ "$install_node" = true ]; then
67+ echo "Installing Node.js $NODE_VERSION.x..."
5268 curl -fsSL https://deb.nodesource.com/setup_${NODE_VERSION}.x | $SUDO bash -
5369 $SUDO apt-get install -y nodejs
54- else
55- echo "Node.js already installed: $(node --version)"
70+ fi
71+
72+ if ! command -v npm &> /dev/null; then
73+ echo "Error: npm is required but was not installed"
74+ exit 1
5675 fi
5776
5877 # Install PM2
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ BLUE='\033[0;34m'
1010NC=' \033[0m' # No Color
1111
1212# ShipNode version
13- VERSION=" 1.4.3 "
13+ VERSION=" 1.4.4 "
1414
1515# SSH multiplexing for connection reuse
1616SSH_CONTROL_PATH=" /tmp/shipnode-ssh-%r@%h:%p"
You can’t perform that action at this time.
0 commit comments