Technical decision · Technical decision

Web Stack Security Overhaul: Node 24 LTS and CRA to Vite

Before/after comparison of an old web stack on end-of-life Node v20 and deprecated CRA, and a new stack on Node 24 LTS with Vite, patched Express and a clean lockfile

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. .nvmrc plus .npmrc with engine-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 overrides for 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.env and renaming files to .jsx.
  • Lockfile hygiene. A clean lockfile v3, npm ci in 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.

Read the full write-up.

My role
Tech lead
Date

← Back to work & speaking