Project scripts and lifecycle
A Next.js app typically uses package scripts for development, building and serving a production build. Development prioritizes feedback while editing; a production build prepares optimized application output. Test the production behavior before making conclusions about routing, caching or deployment.
Common script mapping
{ "scripts": { "dev": "next dev", "build": "next build", "start": "next start" }}This is a partial package.json, not a complete installable manifest. In an approved installed project, npm run dev starts development; npm run build produces build output; npm run start serves a compatible production build.
Local-only checks
Use npm run dev -- --hostname 127.0.0.1 --port 3000 for an approved local lab. Stop it before running a separate production check. After a successful build, use npm run start -- --hostname 127.0.0.1 --port 3000 for the standard Node server output. A static export has different serving requirements. Standalone output also has its own generated Node entry point; do not assume the standard next start command applies to every deployment mode. A successful build is a prerequisite for the standard production start, not a substitute for checking it.
Common mistake
Do not use the development server as production hosting or run start without the required production build. Neither a build nor a server start proves all routes behave correctly.
Try it yourself
Plan a sequence to edit a page, build the app and check the same route in production.
Example status: static walkthrough; Next.js build and browser behavior have not been executed in this authoring environment.