
You can enable more verbose build output with the flag in . This requires Next.js 9.5.3:
next build --debug
With this flag enabled additional build output like rewrites, redirects, and headers will be shown.
next dev starts the application in development mode with hot-code reloading, error reporting, and more:
The application will start at http://localhost:3000 by default. The default port can be changed with -p, like so:
npx next dev -p 4000
Or using the PORT environment variable:
PORT=4000 npx next dev
You can also set the hostname to be different from the default of 0.0.0.0, this can be useful for making the application available for other devices on the network. The default hostname can be changed with -H, like so:
npx next dev -H 192.168.1.2
next start starts the application in production mode. The application should be compiled with next build first.
The application will start at http://localhost:3000 by default. The default port can be changed with -p, like so:
npx next start -p 4000
Or using the PORT environment variable:
PORT=4000 npx next start
next lint runs ESLint for all files in the pages, components, and lib directories. It also provides a guided setup to install any required dependencies if ESLint is not already configured in your application.
If you have other directories that you would like to lint, you can specify them using the --dir flag:
next lint --dir utils
Next.js collects completely anonymous telemetry data about general usage. Participation in this anonymous program is optional, and you may opt-out if you'd not like to share any information.