fix install on older systems

This commit is contained in:
Mateusz Gruszczyński
2025-10-26 15:52:35 +01:00
parent 22f0d16b75
commit 9826d14a36

View File

@@ -265,27 +265,14 @@ def ensure_minimum_nodejs(min_version=MIN_NODEJS_VERSION):
if match: if match:
current_major = int(match.group(1)) current_major = int(match.group(1))
if current_major >= min_version: if current_major >= min_version:
print(f"✓ Node.js {node_ver} is sufficient (>= v{min_version})")
return True return True
else:
print(f"✗ Node.js {node_ver} is too old (< v{min_version})")
else:
print(f"Cannot parse Node.js version: {node_ver}")
except FileNotFoundError: except FileNotFoundError:
print("Node.js not found") pass
except Exception as e: except Exception:
print(f"Error checking Node.js version: {e}") pass
print(f"Installing Node.js v{min_version} from NodeSource...")
install_node_from_nodesource(str(min_version)) install_node_from_nodesource(str(min_version))
return True
try:
node_ver = runout(["node", "--version"], check=False).strip()
print(f"✓ Node.js {node_ver} installed successfully")
return True
except Exception as e:
print(f"Failed to verify Node.js installation: {e}")
return False
def download_extract_tar_gz(url: str, dest_dir: Path) -> Path: def download_extract_tar_gz(url: str, dest_dir: Path) -> Path:
dest_dir.mkdir(parents=True, exist_ok=True) dest_dir.mkdir(parents=True, exist_ok=True)