fix(cli): add explicit Node 18+ version check with helpful error
Summary
Add runtime version check that provides a clear, actionable error message when running on Node.js < 18.
Changes
- Add version check at CLI startup
- Show clear error with EOL dates and upgrade instructions
- Exit gracefully instead of cryptic syntax errors
Why Node 18+ is required
- Node.js 14 reached end-of-life in April 2023
- Node.js 16 reached end-of-life in September 2023
- Supporting EOL versions creates security liability
- Node 18 was released in April 2022 — it's been available for almost 4 years
- Users should upgrade to Node 20 LTS or Node 22 for security updates
Error message example
Error: postgresai requires Node 18 or higher.
You are running Node.js 14.21.3.
Please upgrade to Node.js 20 LTS or Node.js 22 for security updates.
Download: https://nodejs.org/
Closes #112 (closed)
Edited by Nikolay Samokhvalov