Web Stack Overhaul: Node 24 LTS, Safe Express Patches, and CRA to Vite
I recently helped give a long-running web stack a major overhaul. The old version was still on Node v20, which has reached end-of-life, and npm audit was flagging a pile of vulnerabilities. The frontend in particular was built on the deprecated Create React App (CRA), and many of its High/Critical issues simply had no patch available.
The key changes this time:
- Upgrade and pin Node 24 LTS: Added
.nvmrcand.npmrc(engine-strict=true) so everyone from dev to prod runs the same version, avoiding strange errors at deploy time. - Play it safe on the backend: Patch/minor upgrades ONLY, no major version bumps (e.g. staying on Express 4), combined with targeted overrides to clear security vulnerabilities in transitive dependencies.
- Drop CRA for Vite on the frontend: We put the brakes on CRA and formally migrated to Vite! The refactoring cost was lower than expected — switch to
import.meta.envand rename files to the JSX extension — and build speed and dev HMR took off immediately 🚀 - Lockfile hygiene: Wiped the old
node_modulesand rebuilt a clean lockfile v3, switched every deployment tonpm cifor deterministic builds, and added a CI audit for regular scanning.
The most important rule in tech stack maintenance is “small, fast steps, with stability first”. Upgrading too many majors at once just sets off a cascade of breaking changes. With the vulnerabilities cleared and the tooling upgraded, the whole codebase is healthy again!
