node via n
This commit is contained in:
parent
5ae5b64798
commit
d84ac67ffc
@ -106,22 +106,26 @@ install_docker() {
|
|||||||
# Function to install Node.js
|
# Function to install Node.js
|
||||||
install_nodejs() {
|
install_nodejs() {
|
||||||
if get_user_confirmation "Node.js installieren?"; then
|
if get_user_confirmation "Node.js installieren?"; then
|
||||||
if command_exists node; then
|
log_info "Node.js wird installiert/aktualisiert..."
|
||||||
log_info "Node.js ist bereits installiert."
|
|
||||||
else
|
|
||||||
log_info "Node.js wird installiert..."
|
|
||||||
apt install -y curl
|
|
||||||
# Using the latest LTS version (20.x as of now)
|
|
||||||
curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
|
|
||||||
apt install -y nodejs
|
|
||||||
|
|
||||||
# Install latest npm version
|
# Install npm first
|
||||||
|
apt install -y npm
|
||||||
|
|
||||||
|
# Update npm to latest version
|
||||||
npm install -g npm@latest
|
npm install -g npm@latest
|
||||||
|
|
||||||
log_success "Node.js wurde erfolgreich installiert."
|
# Install n module for Node.js version management
|
||||||
|
npm install -g n
|
||||||
|
|
||||||
|
# Install latest stable Node.js version using n
|
||||||
|
n stable
|
||||||
|
|
||||||
|
# Reload shell environment to use new Node.js version
|
||||||
|
export PATH="$PATH"
|
||||||
|
|
||||||
|
log_success "Node.js wurde erfolgreich installiert/aktualisiert."
|
||||||
log_info "Installed Node.js version: $(node --version)"
|
log_info "Installed Node.js version: $(node --version)"
|
||||||
log_info "Installed npm version: $(npm --version)"
|
log_info "Installed npm version: $(npm --version)"
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
log_skip "Node.js-Installation übersprungen."
|
log_skip "Node.js-Installation übersprungen."
|
||||||
fi
|
fi
|
||||||
@ -175,9 +179,8 @@ display_system_overview() {
|
|||||||
if command_exists ufw; then
|
if command_exists ufw; then
|
||||||
echo "✓ UFW ($(ufw status | grep Status | cut -d' ' -f2))"
|
echo "✓ UFW ($(ufw status | grep Status | cut -d' ' -f2))"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo -e "\n${BLUE}[Open Ports]${NC}"
|
echo -e "\n${BLUE}[Open Ports]${NC}"
|
||||||
netstat -tuln | grep LISTEN | awk '{print $4}' | sed 's/.*://'
|
netstat -tuln | grep LISTEN | awk '{print $4}' | sed 's/.*://' | tr '\n' ', ' | sed 's/,$/\n/'
|
||||||
|
|
||||||
echo -e "\n${GREEN}Setup completed! System is ready to use.${NC}\n"
|
echo -e "\n${GREEN}Setup completed! System is ready to use.${NC}\n"
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user