Technical decision · Technical decision
Web Stack Security Overhaul: Node 24 LTS and CRA to Vite
Situation
A web stack that had been running for some time was still on Node v20, which has reached end-of-life. npm audit reported many vulnerabilities, and the frontend was built on the deprecated Create React App, so several High/Critical issues had no patch available.
Decisions and trade-offs
- Pin Node 24 LTS everywhere.
.nvmrcplus.npmrcwithengine-strict=true, so development and production run the same version. - Keep the backend conservative. Patch and minor upgrades only, staying on Express 4, with targeted
overridesfor vulnerable transitive dependencies. A major-version jump would have added breaking changes without fixing more vulnerabilities. - Replace CRA with Vite on the frontend. CRA could not be patched. The migration mainly meant switching to
import.meta.envand renaming files to.jsx. - Lockfile hygiene. A clean lockfile v3,
npm ciin every deployment for deterministic builds, and a scheduled CI audit.
Outcome
The known vulnerabilities were cleared, builds became reproducible, and frontend build speed and dev HMR improved noticeably. The guiding principle was small, safe steps rather than one large upgrade.
- My role
- Tech lead
- Date