Skip to main content

Node.js 22 vs 24 (2026): What Changed & Should You Upgrade?

·PkgPulse Team
0

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

AreaChangeImpact
OpenSSLLevel 2 default — short keys rejectedLow (modern certs unaffected)
fetch()Stricter spec complianceMedium (check non-standard options)
BufferBehavior changes with encodingLow
streams/pipeErrors now throw instead of silentLow-Medium
AbortSignalValidation changesLow
test runnerDefault behavior changesLow
npmv11 lockfile format changeCommit 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

FeatureNode.js 22Node.js 24
LTS statusActive until April 2026Active until October 2027
EOLApril 2027April 2028
npm versionv10v11 (65% faster installs)
V8 version12.x13.4
TypeScript supportExperimental (--experimental-strip-types)Stable
Float16ArrayNoYes
RegExp.escape()NoYes
Built-in glob()PartialYes
WebSocket clientYesYes
require() for ESMYesYes
OpenSSL3.33.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.


Ecosystem & Community

The Node.js project's release cadence and LTS commitment have made it one of the most dependable runtimes in the server-side JavaScript ecosystem. The Node.js Release Working Group maintains clear timelines and communicates breaking changes well in advance, which is why major version upgrades have become increasingly low-drama events for most production applications.

The npm v11 improvement deserves more attention than it typically gets in version announcements. Install speed is a daily friction point for every Node.js developer. A 65% improvement on large projects translates to measurable time savings in CI pipelines — projects with thousands of dependencies that previously took 90 seconds to install can now complete in under 35 seconds. This compounds over thousands of CI runs per month. Several engineering teams have reported CI cost reductions after upgrading to Node.js 24 simply because the reduced install time means faster parallelization and lower compute costs.

The JavaScript runtime ecosystem has also become more competitive in 2026. Bun and Deno have both released production-stable versions with compelling performance characteristics and developer experience improvements. Node.js 24's native TypeScript support is a direct response to Bun and Deno's first-class TypeScript support, acknowledging that the ecosystem has moved past requiring compilation as a workflow step for many use cases.


Real-World Adoption

The enterprise adoption of Node.js 24 has been brisk compared to previous LTS cycles. Several factors contributed: the upgrade path from Node.js 22 is genuinely smooth for most applications, the npm v11 performance improvement is immediately tangible, and the TypeScript stabilization addresses a workflow pain point that has driven some teams toward alternative runtimes.

Cloud providers have updated their managed Node.js offerings quickly. AWS Lambda, Google Cloud Functions, and Azure Functions all added Node.js 24 runtime support within weeks of its LTS designation. This rapid platform support reduces the operational risk of upgrading, since you're not betting on your cloud provider catching up.

Container-based deployments (Kubernetes, Docker Compose) benefit immediately from smaller base images and faster build times. The node:24-alpine image is well-maintained and widely used. Organizations running dozens or hundreds of microservices see cumulative CI savings that justify the upgrade effort even when individual services would be fine staying on Node.js 22.


Developer Experience Deep Dive

The native TypeScript support in Node.js 24 deserves a nuanced assessment. It's genuinely useful for scripts, tooling, and simple server code. Being able to run node script.ts without any configuration or build step is convenient, especially for quick prototyping and internal tools. The performance is excellent because type stripping is essentially free — it's a lexical transformation, not a compilation.

However, the limitations are real for production applications. No type checking means you don't get the safety guarantees that are the primary reason most teams adopt TypeScript. Decorators (used heavily in NestJS, TypeORM, and class-based validation libraries) require --experimental-transform-types which remains unstable. Path aliases and project references don't work without additional tooling.

The practical advice for most teams: use tsx or the TypeScript compiler for development and production TypeScript execution. Use Node.js 24's native TypeScript support for ad-hoc scripts and tooling where the overhead of setting up a proper TypeScript build pipeline isn't justified.

The built-in glob() API is a quiet quality-of-life improvement. The glob package has been one of the most commonly installed development dependencies in the Node.js ecosystem for years. Having it available without installation reduces dependency count and removes a small but perennial point of confusion for new Node.js developers.


Performance & Benchmarks

The V8 13.4 upgrade brings incremental performance improvements across the board. JavaScript benchmark comparisons between Node.js 22 and 24 show approximately 8-15% improvement in compute-intensive workloads, with the greatest gains in modern JavaScript patterns like iterator helpers and generators.

HTTP server performance has improved more modestly — roughly 5% throughput increase on synthetic benchmarks with similar improvements in real workloads. For applications that are I/O-bound (database queries, external API calls) rather than CPU-bound, this improvement is less meaningful than the npm install speed gains.

Memory usage patterns are similar between the two versions. The V8 garbage collector improvements in 13.4 reduce GC pause times slightly, which benefits applications with strict latency requirements.

The 65% npm install speed improvement shows up immediately in practice. A project with 500 production dependencies previously taking 60 seconds to install completes in roughly 22 seconds with npm v11. A monorepo with 2,000 total dependencies that previously took 3 minutes to install can complete in under 70 seconds.


Migration Guide

Most Node.js 22 applications will upgrade to Node.js 24 without code changes. The practical checklist:

First, update your .nvmrc, .node-version, or Dockerfile to specify Node.js 24. Run your full test suite. If tests pass without changes, you're done with the code changes.

Second, delete and regenerate your package-lock.json to create the npm v11 format lockfile. The new format is not backward compatible with npm v10, so commit it to source control and ensure your team's local environments are also on Node.js 24 before doing so to avoid lockfile conflicts.

Third, audit any fetch() calls that use non-standard options. Review your TLS/SSL configurations for legacy certificate compatibility. Neither issue is common in modern applications but both have caused upgrade failures in organizations with older infrastructure.

Fourth, review your CI and deployment configurations. Update Docker base images, Lambda runtime selections, and any Node.js version specifications in CI configuration files.

Finally, run your application in a staging environment on Node.js 24 for at least a few days before promoting to production. This catches any runtime behavior changes that automated tests might miss.


Final Verdict 2026

Node.js 24 is a solid, conservative upgrade from Node.js 22. It doesn't introduce a dramatic paradigm shift — it's Node.js 22 with meaningful improvements in tooling speed, V8 capabilities, and TypeScript workflow ergonomics. For new projects, it's clearly the right choice. For existing Node.js 22 projects, plan your upgrade before April 2026 when Node.js 22 moves from active to maintenance status.

The npm v11 speed improvement alone is worth the upgrade for any team that runs Node.js in CI environments. The compounded savings over time make the upgrade ROI positive even accounting for the testing and verification effort required.

Node.js 24 and the JavaScript Runtime Competition

The upgrade from Node.js 22 to 24 happens against a backdrop of increased runtime competition. Bun and Deno have both matured significantly, and the features that once differentiated them — native TypeScript, faster startup, built-in test runners — are now appearing in Node.js itself. Node.js 24's stable TypeScript stripping, built-in glob() and file utilities, and the improved permission model are all responses to this competitive pressure.

For the vast majority of server-side JavaScript development, Node.js remains the dominant choice due to ecosystem compatibility and cloud platform support. Every major cloud function platform (AWS Lambda, Google Cloud Functions, Azure Functions, Cloudflare Workers) added Node.js 24 support quickly, while Bun and Deno runtime support is available but less mature on managed platforms. Organizations with large existing Node.js codebases have almost no reason to switch runtimes in 2026 — the improvements in Node.js 24 address the workflow pain points that motivated runtime switching in the first place.

The npm v11 improvement deserves particular attention for monorepo teams. Projects using pnpm workspaces or Yarn Berry have had a speed advantage over npm for several years. npm v11's architecture changes close that gap significantly. For organizations that standardized on npm (rather than pnpm or bun) for ecosystem simplicity, upgrading to Node.js 24 and getting npm v11 is the path of least resistance to faster installs.

TypeScript Strategy After Node.js 24

Node.js 24's stable TypeScript support changes the development workflow calculus for backend TypeScript projects. The previous recommended stack — ts-node for development, tsc for type checking, tsup for production builds — simplifies in 2026. With native TypeScript stripping, ts-node is replaced by Node.js itself. The node --watch src/index.ts command provides the development server loop without any additional dependencies. Type checking via tsc --noEmit remains essential and is unchanged. Production builds via tsup or esbuild remain the right choice for bundled output.

This simplification is most meaningful for teams building Node.js utilities, CLIs, and internal tooling. For web applications with JSX, a bundler is still required. For NestJS applications using decorators, --experimental-transform-types is needed. But for the large middle-ground of Express, Fastify, or Hono APIs written in plain TypeScript, Node.js 24 eliminates a setup step that has historically caused friction for new developers. See best JavaScript runtimes 2026 for how Node.js 24 compares to Bun and Deno on the full runtime feature set.

Testing Your Application Against Node.js 24

Before committing to the upgrade in production, a systematic testing approach reduces risk. For applications with comprehensive test suites, running the test suite against Node.js 24 covers the majority of compatibility surface area. For applications with gaps in test coverage, focusing manual testing on areas involving fetch(), crypto operations, and stream behavior addresses the most common Node.js 24 breaking change categories.

Using Docker multi-stage builds to test both Node.js 22 and 24 in CI before committing to the version bump is a low-overhead approach. Add a parallel CI stage that runs your test suite against Node.js 24 before actually changing your primary Node.js version. This gives you confidence that the upgrade is safe without requiring you to maintain both versions in production simultaneously. For teams managing multiple microservices, migrating services one at a time (starting with lower-criticality services) is the safest approach. The 20 fastest growing npm packages 2026 report tracks which packages have already updated their engines field to support Node.js 24, useful for identifying any dependency compatibility risks.


Compare Node.js-related npm packages on PkgPulse.

Compare Node.js 22 and Node.js 24 package health on PkgPulse.

Related: Best JavaScript Testing Frameworks 2026, Best WebSocket Libraries Node.js 2026, Best Monorepo Tools 2026

The 2026 JavaScript Stack Cheatsheet

One PDF: the best package for every category (ORMs, bundlers, auth, testing, state management). Used by 500+ devs. Free, updated monthly.