Skip to content

armgit / Ix

Public Imported from GitHub
0

Understand any codebase instantly. System intelligence for codebases, built for humans and AI.

chore: raise Node floor to 22 to match chalk 6 (#326)

Joseph Mikhail8f2c509beb2c
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 88296185..d06cc850 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -4,7 +4,7 @@
### Prerequisites
-- Node.js 20+
+- Node.js 22+
- Docker and Docker Compose
### Local Setup
diff --git a/README.md b/README.md
index 2cf9a9ea..97977b9a 100644
--- a/README.md
+++ b/README.md
@@ -150,12 +150,12 @@ irm https://raw.githubusercontent.com/ix-infrastructure/ix-cursor-plugin/main/in
The install script sets up everything for you on macOS and Linux. It checks for and installs anything that is missing:
-- Node.js 20 or newer
+- Node.js 22 or newer
- Git
- ripgrep (powers `ix text`)
- Docker and Docker Compose (for the local backend)
-All you need beforehand is a terminal with `curl` (or `wget`). On Windows, install Node.js 20+ and Docker Desktop first, then run the installer.
+All you need beforehand is a terminal with `curl` (or `wget`). On Windows, install Node.js 22+ and Docker Desktop first, then run the installer.
Works on macOS, Linux, and Windows, on both x86-64 and arm64.
diff --git a/ix-cli/package-lock.json b/ix-cli/package-lock.json
index decc6bb2..db7686a1 100644
--- a/ix-cli/package-lock.json
+++ b/ix-cli/package-lock.json
@@ -30,7 +30,7 @@
"vitest": "^4.1.0"
},
"engines": {
- "node": ">=20.0.0"
+ "node": ">=22.0.0"
}
},
"node_modules/@babel/helper-string-parser": {
diff --git a/ix-cli/package.json b/ix-cli/package.json
index 2d29a620..54eb2aa0 100644
--- a/ix-cli/package.json
+++ b/ix-cli/package.json
@@ -13,7 +13,7 @@
"ix": "dist/cli/main.js"
},
"engines": {
- "node": ">=20.0.0"
+ "node": ">=22.0.0"
},
"scripts": {
"build": "node scripts/build-core-ingestion.mjs && node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\" && tsc",
diff --git a/ix-cli/src/cli/main.ts b/ix-cli/src/cli/main.ts
index 56481f57..4ca63726 100644
--- a/ix-cli/src/cli/main.ts
+++ b/ix-cli/src/cli/main.ts
@@ -12,7 +12,7 @@ import { fileURLToPath } from "url";
// Runtime Node version guard. Runs before any command work so users on an
// unsupported Node get an actionable message instead of a cryptic "fetch
// failed" deep inside undici.
-const MIN_NODE_MAJOR = 20;
+const MIN_NODE_MAJOR = 22;
{
const current = process.versions.node;
const major = parseInt(current.split(".")[0] ?? "0", 10);
diff --git a/requirements.txt b/requirements.txt
index a341cd2e..1524be7b 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -29,11 +29,11 @@ git>=2
# STEP 1: Node.js (auto-installed/upgraded if missing or too old)
# ============================================================================
-# Node.js >= 20 (installer targets Node 22 LTS)
+# Node.js >= 22 (installer targets Node 22 LTS)
# macOS: brew install node OR official .pkg installer
# Linux: NodeSource apt/dnf/yum repo (setup_22.x) OR apk
# Windows: manual from https://nodejs.org/
-node>=20
+node>=22
npm>=8 # bundled with Node.js
# ============================================================================
diff --git a/scripts/build-cli.sh b/scripts/build-cli.sh
index 1f865987..112ba885 100755
--- a/scripts/build-cli.sh
+++ b/scripts/build-cli.sh
@@ -20,13 +20,13 @@ CLI_DIR="$IX_DIR/ix-cli"
check_prerequisites() {
if ! command -v node &> /dev/null; then
echo "Error: Node.js is not installed."
- echo " Install: https://nodejs.org/ (v20+ required)"
+ echo " Install: https://nodejs.org/ (v22+ required)"
exit 1
fi
NODE_VERSION=$(node -v | sed 's/v//' | cut -d. -f1)
- if [ "$NODE_VERSION" -lt 20 ]; then
- echo "Error: Node.js 20+ required (found $(node -v))"
+ if [ "$NODE_VERSION" -lt 22 ]; then
+ echo "Error: Node.js 22+ required (found $(node -v))"
exit 1
fi
diff --git a/scripts/dev/setup.sh b/scripts/dev/setup.sh
index 4a9796d6..7f04f125 100755
--- a/scripts/dev/setup.sh
+++ b/scripts/dev/setup.sh
@@ -129,7 +129,7 @@ if [ "${#MISSING_DEPS[@]}" -gt 0 ]; then
for dep in "${MISSING_DEPS[@]}"; do
case "$dep" in
docker) echo " docker: https://docs.docker.com/get-docker/" ;;
- node) echo " node: https://nodejs.org (v20+ required)" ;;
+ node) echo " node: https://nodejs.org (v22+ required)" ;;
esac
done
echo ""
diff --git a/scripts/install/install.ps1 b/scripts/install/install.ps1
index bbad2478..23548880 100644
--- a/scripts/install/install.ps1
+++ b/scripts/install/install.ps1
@@ -15,7 +15,7 @@ $IxBin = "$IxHome\bin"
$ComposeDir = "$IxHome\backend"
$HealthUrl = "http://localhost:8090/v1/health"
$ArangoUrl = "http://localhost:8529/_api/version"
-$NodeMinMajor = 20
+$NodeMinMajor = 22
# ── Helpers ──────────────────────────────────────────────────────────────────
@@ -99,9 +99,32 @@ Write-Host "`n-- Node.js --"
$node = Get-Command node -ErrorAction SilentlyContinue
if ($node) {
- Write-Ok "Node $(& node -v)"
+ # Actually enforce $NodeMinMajor. Until now this check was existence-only,
+ # so $NodeMinMajor was dead and a Windows user on an unsupported Node got
+ # through the installer cleanly, then hit the CLI's own runtime guard on
+ # their first `ix` command. install.sh has always enforced its floor.
+ # [regex]::Match rather than -match: if `node -v` ever prints more than one
+ # line, -match becomes the filter operator and leaves $Matches untouched --
+ # which either throws on a null index, or silently reuses a stale $Matches
+ # from the caller's scope, since README ships this as `irm ... | iex`.
+ # @(...) rather than `| Select-Object -First 1`: -First halts the native
+ # command with StopUpstreamCommandsException, which loses $LASTEXITCODE on
+ # 7 and sets it to -1 on 5.1. Array-wrapping keeps the exit code, and
+ # yields "" rather than AutomationNull when node prints nothing -- casting
+ # AutomationNull to [string] hands Match() a real null, which throws.
+ $nodeLines = @(& node -v)
+ $nodeVer = if ($nodeLines.Count -gt 0) { $nodeLines[0] } else { "" }
+ $nodeMatch = [regex]::Match($nodeVer, '^v?(\d+)')
+ if (-not $nodeMatch.Success) {
+ Write-Err "Could not read the Node version (node -v printed '$nodeVer'). Ix requires Node $NodeMinMajor or newer: https://nodejs.org/"
+ }
+ $nodeMajor = [int]$nodeMatch.Groups[1].Value
+ if ($nodeMajor -lt $NodeMinMajor) {
+ Write-Err "Node $nodeVer is too old. Ix requires Node $NodeMinMajor or newer: https://nodejs.org/"
+ }
+ Write-Ok "Node $nodeVer"
} else {
- Write-Err "Node not installed"
+ Write-Err "Node not installed. Ix requires Node $NodeMinMajor or newer: https://nodejs.org/"
}
# ── Docker ──
diff --git a/scripts/install/install.sh b/scripts/install/install.sh
index 1ea0ec76..3eb9705b 100755
--- a/scripts/install/install.sh
+++ b/scripts/install/install.sh
@@ -28,7 +28,7 @@ COMPOSE_DIR="$IX_HOME/backend"
HEALTH_URL="http://localhost:8090/v1/health"
ARANGO_URL="http://localhost:8529/_api/version"
-NODE_MIN_MAJOR=20
+NODE_MIN_MAJOR=22
# -- Windows / POSIX docker compose wrapper --
#