Learn Nuxt with a Collection of 100+ Tips!

nuxi dev

The dev command starts a development server with hot module replacement at http://localhost:3000
Terminal
npx nuxi dev [ROOTDIR] [--cwd=<directory>] [--logLevel=<silent|info|verbose>] [--dotenv] [--envName] [--no-clear] [--no-fork] [-p, --port] [-h, --host] [--clipboard] [-o, --open] [--https] [--publicURL] [--qr] [--public] [--tunnel] [--sslCert] [--sslKey]

The dev command starts a development server with hot module replacement at http://localhost:3000

Arguments

ArgumentDescription
ROOTDIR="."Specifies the working directory (default: .)

Options

OptionDefaultDescription
--cwd=<directory>Specify the working directory, this takes precedence over ROOTDIR (default: .)
--logLevel=<silent|info|verbose>Specify build-time log level
--dotenvPath to .env file to load, relative to the root directory
--envNameThe environment to use when resolving configuration overrides (default is production when building, and development when running the dev server)
--no-clearDisable clear console on restart
--no-forkDisable forked mode
-p, --portPort to listen on (default: NUXT_PORT || NITRO_PORT || PORT || nuxtOptions.devServer.port)
-h, --hostHost to listen on (default: NUXT_HOST || NITRO_HOST || HOST || nuxtOptions._layers?.[0]?.devServer?.host)
--clipboardfalseCopy the URL to the clipboard
-o, --openfalseOpen the URL in the browser
--httpsEnable HTTPS
--publicURLDisplayed public URL (used for QR code)
--qrDisplay The QR code of public URL when available
--publicListen to all network interfaces
--tunnelOpen a tunnel using https://github.com/unjs/untun
--sslCert(DEPRECATED) Use --https.cert instead.
--sslKey(DEPRECATED) Use --https.key instead.

The port and host can also be set via NUXT_PORT, PORT, NUXT_HOST or HOST environment variables.

Additionally to the above options, nuxi can pass options through to listhen, e.g. --no-qr to turn off the dev server QR code. You can find the list of listhen options in the unjs/listhen docs.

This command sets process.env.NODE_ENV to development.

If you are using a self-signed certificate in development, you will need to set NODE_TLS_REJECT_UNAUTHORIZED=0 in your environment.