Skip to content

Commit e5b3152

Browse files
committed
fix(ci): restore strict npm ci and standardize minimum Node engine to >=22.12.0
1 parent e335a89 commit e5b3152

6 files changed

Lines changed: 16 additions & 19 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ jobs:
3434
- name: Install Dependencies
3535
shell: bash
3636
run: |
37-
npm install --no-audit 2>&1 | tee npm-install.log || {
38-
echo "::error::$(tail -n 10 npm-install.log | tr '\n' ' ')"
37+
npm ci 2>&1 | tee npm-ci.log || {
38+
echo "::error::$(tail -n 10 npm-ci.log | tr '\n' ' ')"
3939
exit 1
4040
}
4141

‎README.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ OpenCode Router provides genuine cross-platform support with dedicated native la
119119
| **Windows 11 (x64)** | **Tested & Verified** | Native PowerShell & CMD launchers; per-user AppData storage; native `xray.exe`. |
120120
| **Windows 10 (x64)** | **Tested & Verified** | Native PowerShell & CMD launchers; build 19041+ supported. |
121121
| **Ubuntu 24.04 LTS (x86_64)** | **Tested & Verified** | Primary Linux development and validation environment. |
122-
| Ubuntu 22.04 LTS / Debian 12 | *Compatible* | Requires Node.js >= 20.19.0 or >= 22.12.0 and standard bash. |
122+
| Ubuntu 22.04 LTS / Debian 12 | *Compatible* | Requires Node.js >= 22.12.0 and standard bash. |
123123
| Windows 11 (ARM64) | *Implemented (Unverified)* | ARM64 asset provisioned; unverified on physical ARM64 hardware. |
124124
| macOS (Apple Silicon / Intel) | *Compatible* | Native bash launcher and macOS Xray binaries supported. |
125125

@@ -132,13 +132,13 @@ OpenCode Router provides genuine cross-platform support with dedicated native la
132132

133133
### On Windows
134134
- **Operating System**: Windows 10 (Build 19041+) or Windows 11 (64-bit x64 primary target; ARM64 asset implemented)
135-
- **Node.js Runtime**: v20.19.0+ or v22.12.0+ ([Download Node.js](https://nodejs.org)) — *strictly required by Vite 8*
135+
- **Node.js Runtime**: v22.12.0+ ([Download Node.js](https://nodejs.org)) — *strictly required by better-sqlite3 and Vite 8*
136136
- **Shell**: Windows PowerShell 5.1+, PowerShell 7+, Windows Terminal, or CMD
137137
- **Target Application**: OpenCode CLI installed (`npm install -g opencode-ai`)
138138

139139
### On Linux
140140
- **Operating System**: Ubuntu 24.04 LTS / Debian 12 / Compatible Linux (64-bit)
141-
- **Node.js Runtime**: v20.19.0+ or v22.12.0+ (`node -v`) — *strictly required by Vite 8*
141+
- **Node.js Runtime**: v22.12.0+ (`node -v`) — *strictly required by better-sqlite3 and Vite 8*
142142
- **Package Manager**: npm (`npm -v`)
143143
- **Target Application**: OpenCode CLI installed (e.g. `/usr/local/bin/opencode`)
144144

‎docs/guide/installation.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@ sudo apt update
3232
# Install system utilities
3333
sudo apt install -y curl unzip git
3434

35-
# Verify Node.js (version 18.0.0 or higher required)
35+
# Verify Node.js (version 22.12.0 or higher required)
3636
node -v
3737
npm -v
3838
```
3939

4040
If Node.js is not installed, install it using the official NodeSource repository or nvm:
4141
```bash
42-
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
42+
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
4343
sudo apt install -y nodejs
4444
```
4545

‎scripts/package-portable.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ OpenCode Router v${version} - Native Windows Portable Edition
9898
==========================================================
9999
100100
Prerequisites (Host Machine):
101-
1. Node.js 20.19+ or 22.12+ (https://nodejs.org) [Required for Vite 8 / Server runtime]
101+
1. Node.js 22.12+ (https://nodejs.org) [Required for Vite 8 / better-sqlite3 / Server runtime]
102102
2. OpenCode CLI: npm install -g opencode-ai
103103
104104
Note on Architecture:

‎scripts/windows/check-environment.ps1‎

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,29 +23,26 @@ $osArch = (Get-CimInstance Win32_Processor).AddressWidth
2323
Write-Host "[[v]] Operating System: " -NoNewline -ForegroundColor Green
2424
Write-Host "$($os.Caption) ($osArch-bit, Build $($os.BuildNumber))"
2525

26-
# 2. Node.js Runtime (Vite 8 requires Node.js 20.19+ or 22.12+)
26+
# 2. Node.js Runtime (better-sqlite3 and Vite 8 require Node.js >= 22.12.0)
2727
$nodeCmd = Get-Command node -ErrorAction SilentlyContinue
2828
if ($nodeCmd) {
2929
$nodeVer = (node -v).Trim().TrimStart('v')
3030
$parts = $nodeVer.Split('.')
3131
$major = [int]$parts[0]
3232
$minor = if ($parts.Length -gt 1) { [int]$parts[1] } else { 0 }
3333

34-
$isVite8Compatible = ($major -eq 20 -and $minor -ge 19) -or ($major -ge 22 -and $minor -ge 12) -or ($major -gt 22)
34+
$isNodeCompatible = ($major -eq 22 -and $minor -ge 12) -or ($major -gt 22)
3535

36-
if ($isVite8Compatible) {
36+
if ($isNodeCompatible) {
3737
Write-Host "[[v]] Node.js Runtime: " -NoNewline -ForegroundColor Green
3838
Write-Host "v$nodeVer ($($nodeCmd.Source))"
39-
} elseif ($major -ge 20) {
40-
Write-Host "[!] Node.js Runtime: " -NoNewline -ForegroundColor Yellow
41-
Write-Host "v$nodeVer (Warning: Vite 8 requires Node.js 20.19+ or 22.12+)"
4239
} else {
4340
Write-Host "[[x]] Node.js Runtime: " -NoNewline -ForegroundColor Red
44-
Write-Host "v$nodeVer (Incompatible: Vite 8 strictly requires Node.js 20.19+ or 22.12+)"
41+
Write-Host "v$nodeVer (Incompatible: better-sqlite3 and Vite 8 strictly require Node.js >= 22.12.0)"
4542
$allPassed = $false
4643
}
4744
} else {
48-
Write-Host "[[x]] Node.js Runtime: Not found in PATH! (Node.js 20.19+ or 22.12+ required: https://nodejs.org)" -ForegroundColor Red
45+
Write-Host "[[x]] Node.js Runtime: Not found in PATH! (Node.js >= 22.12.0 required: https://nodejs.org)" -ForegroundColor Red
4946
$allPassed = $false
5047
}
5148

‎scripts/windows/verify-release.ps1‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
.DESCRIPTION
55
Non-privileged verification suite for Windows 10/11 x64:
66
- Host Windows OS & architecture
7-
- Node.js runtime version (^20.19.0 || >=22.12.0)
7+
- Node.js runtime version (>=22.12.0)
88
- Native SQLite (better-sqlite3) binary module loading
99
- Native C# launcher (opencode-vpn.exe) compilation & execution
1010
- OpenCode CLI discovery & resolution
@@ -90,8 +90,8 @@ if ($nodeCmd) {
9090
$nodeVerStr = (& node -v).Trim()
9191
$results.node.version = $nodeVerStr
9292
$nodeVer = [version]($nodeVerStr -replace '^v', '')
93-
$nodeValid = ($nodeVer.Major -eq 20 -and $nodeVer.Minor -ge 18) -or ($nodeVer.Major -ge 22 -and $nodeVer.Minor -ge 12) -or ($nodeVer.Major -gt 22)
94-
Log-Test "Node.js Version Requirement (^20.18.0 || >=22.12.0)" $nodeValid "Detected: $nodeVerStr ($($nodeCmd.Source))"
93+
$nodeValid = ($nodeVer.Major -eq 22 -and $nodeVer.Minor -ge 12) -or ($nodeVer.Major -gt 22)
94+
Log-Test "Node.js Version Requirement (>=22.12.0)" $nodeValid "Detected: $nodeVerStr ($($nodeCmd.Source))"
9595
} else {
9696
Log-Test "Node.js Runtime Installed" $false "Node.js executable not found in PATH"
9797
}

0 commit comments

Comments
 (0)