Upgrading Node.js from 24 LTS to 26 LTS
Why upgrade
Node.js LTS lines overlap so that a supported upgrade target always exists. As the older line approaches end of life, its security patch window shrinks, while the newer LTS keeps receiving fixes for roughly 2.5 years. Moving before the old line is EOL avoids doing the migration under time pressure.
Before you start
- Pin the exact 26.x version you upgrade to (LTS picks a codename, check the release schedule below).
- Inventory native modules (node-gyp builds, workers such as sharp or bcrypt) — these are the most common source of breakage.
- Run your full test suite on 24 first so you can attribute failures to the runtime change.
Migration steps
Step 1: Install the new LTS
nvm install --lts
nvm use --lts
# or with fnm
fnm install 26 && fnm use 26
node --version
Step 2: Rebuild native modules
rm -rf node_modules
npm ci
npm rebuild
Step 3: Update the engines field
{ "engines": { "node": ">=26" } }
Step 4: Test and watch for deprecation warnings
npm test
node --trace-warnings your-entry.js
Step 5: Roll out gradually
Update CI matrix first, then staging, then production behind your normal deploy process.
Compatibility checklist
- Native addons compiled for 24 must be rebuilt for the new ABI.
- Review the official changelog between 24 and 26 for removed APIs before upgrading: the release notes list every breaking change.
- Docker base images: bump the tag and rebuild, do not mix runtimes inside one image.