From 97f945637849b39e13c9792458e6a336ccdb6f3b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 22 Mar 2026 01:32:20 +0000 Subject: [PATCH 1/4] Initial plan From 5e2cf0fdec3c7a7d447d1d64e9db9c00dfaedddd Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 22 Mar 2026 01:36:24 +0000 Subject: [PATCH 2/4] Use NodeSource repos for reliable Node.js 18+ installation on Linux Co-authored-by: ChangeHow <23733347+ChangeHow@users.noreply.github.com> Agent-Logs-Url: https://github.com/ChangeHow/suitup/sessions/96c63f7e-7f36-4db4-a11a-5c2983e445da --- install.sh | 14 ++++++++++++-- tests/install-script.test.js | 18 ++++++++++++++++++ 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index 12f5190..292787b 100644 --- a/install.sh +++ b/install.sh @@ -137,10 +137,20 @@ ensure_node_runtime() { install_with_manager "${manager}" node ;; apt-get) - install_with_manager "${manager}" nodejs npm + log "Adding NodeSource repository for Node.js 18..." + if ! curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -; then + echo "Failed to set up NodeSource repository for Node.js." >&2 + exit 1 + fi + install_with_manager "${manager}" nodejs ;; dnf|yum) - install_with_manager "${manager}" nodejs npm + log "Adding NodeSource repository for Node.js 18..." + if ! curl -fsSL https://rpm.nodesource.com/setup_18.x | sudo -E bash -; then + echo "Failed to set up NodeSource repository for Node.js." >&2 + exit 1 + fi + install_with_manager "${manager}" nodejs ;; *) echo "No supported package manager available to install Node.js." >&2 diff --git a/tests/install-script.test.js b/tests/install-script.test.js index 35eee5c..ea3c12c 100644 --- a/tests/install-script.test.js +++ b/tests/install-script.test.js @@ -47,4 +47,22 @@ describe("install.sh", () => { expect(content).toContain('Unknown command: ${CLI_COMMAND}'); }); + + test("skips Node.js installation when a compatible version is already present", () => { + const content = readFileSync(INSTALL_SCRIPT, "utf-8"); + + // ensure_node_runtime returns early when node + npm are found at version >= 18 + expect(content).toContain("if have_cmd node && have_cmd npm;"); + expect(content).toMatch(/"\$\{major\}" -ge 18/); + expect(content).toContain("return 0"); + }); + + test("uses NodeSource repository for reliable Node.js installation on Linux", () => { + const content = readFileSync(INSTALL_SCRIPT, "utf-8"); + + expect(content).toContain("https://deb.nodesource.com/setup_18.x"); + expect(content).toContain("https://rpm.nodesource.com/setup_18.x"); + // NodeSource setup scripts are piped into bash with sudo + expect(content).toMatch(/curl.*nodesource.*\| sudo -E bash -/s); + }); }); From 00d3da34e36714abc8b2b01b9e45e29af3cddfde Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 22 Mar 2026 01:43:22 +0000 Subject: [PATCH 3/4] Bump minimum Node.js requirement from 18 to 20 Co-authored-by: ChangeHow <23733347+ChangeHow@users.noreply.github.com> Agent-Logs-Url: https://github.com/ChangeHow/suitup/sessions/4dc0df07-50ce-4a7c-8cc7-9f713eba218d --- install.sh | 16 ++++++++-------- tests/install-script.test.js | 8 ++++---- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/install.sh b/install.sh index 292787b..2e639e0 100644 --- a/install.sh +++ b/install.sh @@ -126,7 +126,7 @@ ensure_node_runtime() { if have_cmd node && have_cmd npm; then major="$(node_major)" - if [[ -n "${major}" && "${major}" -ge 18 ]]; then + if [[ -n "${major}" && "${major}" -ge 20 ]]; then return 0 fi fi @@ -137,16 +137,16 @@ ensure_node_runtime() { install_with_manager "${manager}" node ;; apt-get) - log "Adding NodeSource repository for Node.js 18..." - if ! curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -; then + log "Adding NodeSource repository for Node.js 20..." + if ! curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -; then echo "Failed to set up NodeSource repository for Node.js." >&2 exit 1 fi install_with_manager "${manager}" nodejs ;; dnf|yum) - log "Adding NodeSource repository for Node.js 18..." - if ! curl -fsSL https://rpm.nodesource.com/setup_18.x | sudo -E bash -; then + log "Adding NodeSource repository for Node.js 20..." + if ! curl -fsSL https://rpm.nodesource.com/setup_20.x | sudo -E bash -; then echo "Failed to set up NodeSource repository for Node.js." >&2 exit 1 fi @@ -164,8 +164,8 @@ ensure_node_runtime() { fi major="$(node_major)" - if [[ -z "${major}" || "${major}" -lt 18 ]]; then - echo "suitup requires Node.js 18 or later. Installed version is $(node -v)." >&2 + if [[ -z "${major}" || "${major}" -lt 20 ]]; then + echo "suitup requires Node.js 20 or later. Installed version is $(node -v)." >&2 exit 1 fi } @@ -187,7 +187,7 @@ require_cmd uname PACKAGE_MANAGER="$(detect_package_manager || true)" if [[ -z "${PACKAGE_MANAGER}" ]]; then - echo "Could not detect a supported package manager. Install zsh and Node.js 18+ manually, then rerun suitup." >&2 + echo "Could not detect a supported package manager. Install zsh and Node.js 20+ manually, then rerun suitup." >&2 exit 1 fi diff --git a/tests/install-script.test.js b/tests/install-script.test.js index ea3c12c..f3ac724 100644 --- a/tests/install-script.test.js +++ b/tests/install-script.test.js @@ -51,17 +51,17 @@ describe("install.sh", () => { test("skips Node.js installation when a compatible version is already present", () => { const content = readFileSync(INSTALL_SCRIPT, "utf-8"); - // ensure_node_runtime returns early when node + npm are found at version >= 18 + // ensure_node_runtime returns early when node + npm are found at version >= 20 expect(content).toContain("if have_cmd node && have_cmd npm;"); - expect(content).toMatch(/"\$\{major\}" -ge 18/); + expect(content).toMatch(/"\$\{major\}" -ge 20/); expect(content).toContain("return 0"); }); test("uses NodeSource repository for reliable Node.js installation on Linux", () => { const content = readFileSync(INSTALL_SCRIPT, "utf-8"); - expect(content).toContain("https://deb.nodesource.com/setup_18.x"); - expect(content).toContain("https://rpm.nodesource.com/setup_18.x"); + expect(content).toContain("https://deb.nodesource.com/setup_20.x"); + expect(content).toContain("https://rpm.nodesource.com/setup_20.x"); // NodeSource setup scripts are piped into bash with sudo expect(content).toMatch(/curl.*nodesource.*\| sudo -E bash -/s); }); From a06c39abe56e399572737f54da120383ae3ee6a5 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 22 Mar 2026 01:45:26 +0000 Subject: [PATCH 4/4] Use NodeSource LTS URL instead of pinned Node 20 version Co-authored-by: ChangeHow <23733347+ChangeHow@users.noreply.github.com> Agent-Logs-Url: https://github.com/ChangeHow/suitup/sessions/a731a56d-aa64-4248-94c0-8ac77ae3f058 --- install.sh | 8 ++++---- tests/install-script.test.js | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/install.sh b/install.sh index 2e639e0..e23151a 100644 --- a/install.sh +++ b/install.sh @@ -137,16 +137,16 @@ ensure_node_runtime() { install_with_manager "${manager}" node ;; apt-get) - log "Adding NodeSource repository for Node.js 20..." - if ! curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -; then + log "Adding NodeSource LTS repository..." + if ! curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -; then echo "Failed to set up NodeSource repository for Node.js." >&2 exit 1 fi install_with_manager "${manager}" nodejs ;; dnf|yum) - log "Adding NodeSource repository for Node.js 20..." - if ! curl -fsSL https://rpm.nodesource.com/setup_20.x | sudo -E bash -; then + log "Adding NodeSource LTS repository..." + if ! curl -fsSL https://rpm.nodesource.com/setup_lts.x | sudo -E bash -; then echo "Failed to set up NodeSource repository for Node.js." >&2 exit 1 fi diff --git a/tests/install-script.test.js b/tests/install-script.test.js index f3ac724..440b72f 100644 --- a/tests/install-script.test.js +++ b/tests/install-script.test.js @@ -60,8 +60,8 @@ describe("install.sh", () => { test("uses NodeSource repository for reliable Node.js installation on Linux", () => { const content = readFileSync(INSTALL_SCRIPT, "utf-8"); - expect(content).toContain("https://deb.nodesource.com/setup_20.x"); - expect(content).toContain("https://rpm.nodesource.com/setup_20.x"); + expect(content).toContain("https://deb.nodesource.com/setup_lts.x"); + expect(content).toContain("https://rpm.nodesource.com/setup_lts.x"); // NodeSource setup scripts are piped into bash with sudo expect(content).toMatch(/curl.*nodesource.*\| sudo -E bash -/s); });