Node.js runtime
The default Next.js runtime, where server code runs on Node.js with access to every Node API and npm package.
In more detail
Choose it for database drivers that use TCP, file system access, PDF generation and other native libraries. On serverless platforms it usually has slower cold starts than the Edge runtime.
Related terms
- Edge runtime — A lightweight Next.js runtime based on V8 isolates and standard Web APIs, which starts almost instantly but cannot use most Node.js APIs.
- Node.js — A program that runs JavaScript outside the web browser, used mainly to build servers, command-line tools and back-end services.
- export const runtime — The route segment option that picks the runtime for a page, layout or Route Handler: 'nodejs' (default) or 'edge'.
Taught in
- Runtime Environments: Node.js vs Edge Runtime Choice — Next.js 15 & Modern App Router Architecture
- Instrumentation: OpenTelemetry & Performance Spans — Next.js 15 & Modern App Router Architecture