Dev and Production

Running Next.js in Development and Production

package.json defines dev, build and start, wrapping next dev, next build and next start, plus a lint script that now calls eslint directly. npm 2,036 run dev compiles on demand — nothing is built until a request arrives for it, which is why start-up stays in the hundreds of milliseconds however large the project grows. Pass --port, since the Express 24,430 API of Express.js holds 3000, the Next.js 10,514 default.

Output of 5
▲ Next.js 16.3.5 (Turbopack)
- Local:         http://localhost:3111
- Network:       http://10.159.13.176:3111
✓ Ready in 563ms
 GET /books 200 in 404ms (next.js: 229ms, application-code: 175ms)
 GET /books/2 200 in 586ms (next.js: 540ms, application-code: 46ms)

Read the per-request line carefully: it splits the total into framework time and your time, so a slow page says whether the problem is your query or the render. Because these pages are Server Components, the list below is built on the server; turn JavaScript off and it still renders.

The /books route served by the development server
The /books route served by the development server

next build is a different program. It compiles everything, type-checks the project, renders every page that can be prerendered, and reports what it decided:

Output of 5
▲ Next.js 16.3.5 (Turbopack)
✓ Compiled successfully in 3.5s
✓ Generating static pages using 7 workers (5/5) in 722ms
Route (app)
┌ ○ /
├ ○ /_not-found
├ ○ /books
└ ƒ /books/[id]
○  (Static)   prerendered as static content
ƒ  (Dynamic)  server-rendered on demand

That route table is the most useful thing in the output. /books is marked ○: its HTML was produced once, at build time, and every visitor gets the same file. /books/[id] is marked ƒ: the segment has no generateStaticParams, so Next.js cannot know the ids in advance and renders it per request. A route you expected to be static appearing as dynamic almost always means it read a cookie, a header or a search parameter (Rendering Modes). next start then serves the build with no compiler in the process, and refuses to run without one.

Turbopack 10,514 handles dev and build by default since Next.js 16; --webpack on either opts out when a plugin you need has no Turbopack equivalent. Two more commands matter: next typegen regenerates route types, and next info prints the versions for a bug report.