curl checks

This commit is contained in:
shocknet-justin 2025-11-04 15:15:50 -05:00
parent 64dbd2f460
commit 3502858ce2
2 changed files with 25 additions and 1 deletions

View file

@ -13,7 +13,7 @@ log() {
SCRIPT_VERSION="0.2.3
REPO="shocknet/Lightning.Pub"
BRANCH="master"
BRANCH="wizard-update
cleanup() {
log "Cleaning up temporary files..."

View file

@ -8,6 +8,30 @@ install_nodejs() {
log "${PRIMARY_COLOR}Checking${RESET_COLOR} for Node.js..."
MINIMUM_VERSION="18.0.0"
# Check for curl (required by nvm installer)
if ! command -v curl &> /dev/null; then
log "ERROR: curl is required for Node.js installation"
log ""
log "Please install curl first:"
log " Debian/Ubuntu: sudo apt install curl"
log " Fedora/RHEL: sudo dnf install curl"
log " Arch: sudo pacman -S curl"
log ""
exit 1
fi
# Check for snap curl which cannot access hidden folders
if snap list 2>/dev/null | grep -q "^curl "; then
log "ERROR: Snap curl detected"
log ""
log "Snap curl cannot access hidden folders needed for Node.js installation."
log "Please remove snap curl and install native curl:"
log " sudo snap remove curl"
log " sudo apt install curl"
log ""
exit 1
fi
# Load nvm if it already exists
export NVM_DIR="${NVM_DIR}"
[ -s "${NVM_DIR}/nvm.sh" ] && \. "${NVM_DIR}/nvm.sh"