Interactive development
Run an application locally while editing routes and components.
Next.js 16+ · Command
next dev starts a Next.js application in development mode with Hot Module Reloading and error reporting. It supports options for server configuration, debugging, and experimental development builds.
The command launches a Next.js application in development mode. It enables Hot Module Reloading and development-time error reporting; options can adjust the server, debugging, and build behavior.
pnpm next dev [options]| Name | Type | Description |
|---|---|---|
command | string | The Next.js CLI subcommand, such as dev. |
options | string | Optional flags controlling development-server behavior and builds. |
Starts the Next.js development server and continues running until stopped.
next dev to run the App Router application with live module updates and development diagnostics.compile, generate, or the default mode..next/dev, so development and production builds can run concurrently without sharing the same output directory.npm run dev -- --port 3001Runs the package script and forwards the port option to the Next.js development server.
Run an application locally while editing routes and components.
Inspect server-side code during local debugging.
Limit work to selected routes or diagnose prerender failures.
next dev do?next dev starts the application in development mode with Hot Module Reloading and error reporting. It is intended for local development rather than serving an optimized production build.
Follow-up: How can development and production builds coexist? Next.js writes development output to .next/dev, while production output uses the normal build directory.
The command accepts development-specific options, including port selection and debugging flags. A package script can forward them, for example, npm run dev -- --port 3001.
Follow-up: How would you debug server-side code? Pass --inspect to the development command; --inspect-brk and --inspect-wait instead require NODE_OPTIONS.
The CLI syntax is pnpm next [command] [options], and next dev is the development command. Running next without a command is equivalent to running next dev.
Follow-up: What happens when next dev and next build run together? Separate output directories and a lockfile mechanism prevent conflicts between concurrent instances.
next buildnext startHot Module ReloadingNext.js CLIApp Router