Node.js 22 vs Node.js 24: Which LTS to Use in 2026?
Node.js 24 shipped npm v11 — 65% faster installs than v10. It updated V8 to add Float16Array and RegExp.escape(), tightened fetch() compliance, and promoted native TypeScript type-stripping to stable. Node.js 22 is still in active LTS, supported until April 2027. If you're starting a new project in 2026, the choice is clear — but upgrading existing applications requires understanding what breaks.
TL;DR
Node.js 24 for new projects — it's LTS as of October 2025, includes npm v11, a more capable V8 engine, and stable native TypeScript support. Node.js 22 remains valid for production applications that need a proven, stable platform through April 2027. If you're maintaining a Node.js 22 app, plan the upgrade path to 24 — but there's no emergency. If you're starting fresh, Node.js 24 is the right foundation.
Key Takeaways
- Node.js 22: LTS since April 2024, active support until April 2026, maintenance until April 2027
- Node.js 24: LTS since October 2025, active support until October 2027, maintenance until April 2028
- Node.js 24: npm v11 (65% faster large installs vs v10)
- Node.js 24: V8 13.4 — Float16Array, RegExp.escape(), improved performance
- Node.js 22: Native TypeScript support (--strip-types) introduced as experimental
- Node.js 24: Native TypeScript support stable (--strip-types enabled by default for .ts files)
- Node.js 24: Breaking changes — OpenSSL 3.5 security level 2 default, stricter fetch(), Buffer changes
LTS Release Timeline
Node.js follows a predictable LTS cadence: even-numbered releases become LTS, odd-numbered are Current (non-LTS).
Node.js 22: April 2024 → LTS October 2024 → End of Life April 2027
Node.js 23: October 2024 → Current (no LTS) → EOL June 2025
Node.js 24: May 2025 → LTS October 2025 → End of Life April 2028
Node.js 25: October 2025 → Current (no LTS) → EOL June 2026
Node.js 26: April 2026 → LTS October 2026 → End of Life April 2029
For production applications: stay on LTS. Skip odd-numbered releases entirely unless you need bleeding-edge features.
Node.js 22 Features (Recap)
Node.js 22 was a significant LTS release focused on ESM maturity and developer productivity.
require() for ES Modules
The long-awaited fix: synchronous require() for ESM files works reliably.
// Before Node.js 22: This would fail or require --experimental-vm-modules
const { something } = require('./my-esm-module.mjs');
// Node.js 22+: Works without flags
const { something } = require('./esm-module.mjs');
This eliminated a major compatibility headache when mixing CJS and ESM in the same project.
WebSocket Client (Built-In)
// Node.js 22: Built-in WebSocket client — no ws or socket.io needed for client usage
const ws = new WebSocket('wss://example.com/socket');
ws.addEventListener('open', () => {
ws.send('Hello!');
});
ws.addEventListener('message', ({ data }) => {
console.log('Received:', data);
});
No npm install ws needed for client-side WebSocket connections.
Native TypeScript Support (Experimental)
# Node.js 22.18+ (experimental)
node --experimental-strip-types src/script.ts
Type annotations are stripped at runtime using V8's built-in parser — no transpilation, no type checking, just type erasure. Decorators and complex TypeScript syntax not supported in this mode.
Stream Performance
The default high watermark for streams increased from 16 KB to 65 KB, improving throughput for file I/O and HTTP streaming without code changes.
Task Runner (--run flag)
# Run npm scripts without npm run prefix
node --run build # Equivalent to npm run build
node --run test # Equivalent to npm run test
Node.js 24 Features
npm v11
npm v11 ships with Node.js 24 — the biggest day-to-day improvement for most developers:
# npm v11 — 65% faster large installs
npm install # significantly faster for large projects
# npm v11 improvements:
# - Faster package resolution
# - Improved workspace support
# - Better peerDependency handling
# - Updated lockfile format
# Check your npm version
node -v # v24.x.x
npm -v # 11.x.x
V8 13.4 — New JavaScript Features
// Float16Array — new typed array for 16-bit floating point
const arr = new Float16Array(4);
arr[0] = 3.14;
console.log(arr[0]); // 3.140625 (nearest float16 value)
// RegExp.escape() — safely escape strings for use in RegExp
const userInput = 'Hello (World)!';
const pattern = new RegExp(RegExp.escape(userInput));
console.log(pattern.test('Hello (World)!')); // true
// Without escape: '(' would break the regex
// Iterator helpers
const iter = [1, 2, 3, 4, 5].values();
const doubled = iter.map(x => x * 2).take(3);
console.log([...doubled]); // [2, 4, 6]
Stable Native TypeScript Support
Node.js 22 introduced --experimental-strip-types; Node.js 24 promotes it to stable:
// script.ts
const name: string = 'World';
const greet = (who: string): string => `Hello, ${who}!`;
console.log(greet(name));
# Node.js 24: works without flags for .ts files
node script.ts
# Hello, World!
Limitations remain:
- No type checking (types are stripped, not verified)
- No TypeScript transformations (enums, decorators need
--experimental-transform-types) - For full TypeScript: still use tsx or Bun
Built-in glob() and rimraf()
// Node.js 22.6+, stabilized in 24: built-in glob
import { glob } from 'node:fs';
// Find all TypeScript files
const tsFiles = [];
for await (const file of glob('**/*.ts', { exclude: ['node_modules/**'] })) {
tsFiles.push(file);
}
console.log(tsFiles);
// Node.js 24: rimraf-like recursive delete
import { rm } from 'node:fs/promises';
await rm('./dist', { recursive: true, force: true });
// No rimraf package needed
Stricter fetch() Compliance
Node.js 24 tightened fetch() to match the WHATWG Fetch specification:
// Node.js 22: fetch with non-standard options worked silently
// Node.js 24: throws TypeError for invalid options
// This may break existing code:
const response = await fetch(url, {
// Some non-standard options that Node.js 22 ignored but Node.js 24 rejects
});
Check your fetch() usage if upgrading — particularly around credentials, CORS modes, and custom headers.
OpenSSL 3.5 Security Level 2
Node.js 24 uses OpenSSL 3.5 with security level 2 as the default:
// Node.js 24 rejects these:
// - RSA/DSA/DH keys shorter than 2048 bits
// - ECC keys shorter than 224 bits
// - MD5, SHA-1 in signatures
// If your app connects to servers with legacy TLS configurations:
// You may see: Error: routines:ssl_choose_client_version:unsupported protocol
For most modern applications, this change is invisible. For legacy integrations, you may need to update server certificates or TLS configuration.
Permission Model Improvements
# Node.js 24: more granular permissions
node --experimental-permission \
--allow-fs-read=/home/user/data \
--allow-net=api.example.com \
script.ts
The permission model lets you run scripts with minimal capabilities — similar to Deno's permission system.
Breaking Changes: What Breaks on Node.js 24
| Area | Change | Impact |
|---|---|---|
| OpenSSL | Level 2 default — short keys rejected | Low (modern certs unaffected) |
| fetch() | Stricter spec compliance | Medium (check non-standard options) |
| Buffer | Behavior changes with encoding | Low |
| streams/pipe | Errors now throw instead of silent | Low-Medium |
| AbortSignal | Validation changes | Low |
| test runner | Default behavior changes | Low |
| npm | v11 lockfile format change | Commit the new lockfile |
Upgrade Path
Testing Before Upgrading
# Use nvm to test both versions:
nvm install 24
nvm use 24
npm install # Regenerates lockfile with npm v11
npm test # Run your test suite
Common Issues and Fixes
// 1. fetch() options — check for non-standard usage
// Replace any custom mode/credentials that aren't spec-compliant
// 2. Old crypto keys — update any RSA < 2048 or EC < 224 configs
const { generateKeyPair } = require('crypto');
generateKeyPair('rsa', { modulusLength: 2048 }, callback); // OK
// generateKeyPair('rsa', { modulusLength: 1024 }, ...) // Fails in v24
// 3. npm lockfile — regenerate and commit
rm package-lock.json
npm install # Generates npm v11 lockfile
git add package-lock.json
Node.js 22 vs Node.js 24 Comparison
| Feature | Node.js 22 | Node.js 24 |
|---|---|---|
| LTS status | Active until April 2026 | Active until October 2027 |
| EOL | April 2027 | April 2028 |
| npm version | v10 | v11 (65% faster installs) |
| V8 version | 12.x | 13.4 |
| TypeScript support | Experimental (--experimental-strip-types) | Stable |
| Float16Array | No | Yes |
| RegExp.escape() | No | Yes |
| Built-in glob() | Partial | Yes |
| WebSocket client | Yes | Yes |
| require() for ESM | Yes | Yes |
| OpenSSL | 3.3 | 3.5 (stricter) |
Which Version to Use in 2026
New projects: Node.js 24. It's LTS, more capable, and starts you on the longer support timeline (2028 vs 2027).
Existing Node.js 22 projects: No urgency to upgrade immediately. Node.js 22 has active support through April 2026 and maintenance through April 2027. Test on Node.js 24 when convenient, target upgrading before April 2026.
Docker/CI: Update your base images:
# Before
FROM node:22-alpine
# After (Node.js 24 LTS)
FROM node:24-alpine
Package authors: Test against both Node.js 22 and 24 in CI. Add "engines": { "node": ">=22" } to your package.json to be explicit about minimum support.
Compare Node.js-related npm packages on PkgPulse.
See the live comparison
View nodejs 22 vs. nodejs 24 on PkgPulse →