Skip to content

Commit 41a9fe5

Browse files
committed
docs: correct dev, analyze and init command details
1 parent 5d39ad0 commit 41a9fe5

4 files changed

Lines changed: 11 additions & 7 deletions

File tree

docs/1.overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,6 @@ npm install -D @nuxt/cli-nightly
9898
npx @nuxt/cli-nightly dev
9999
```
100100

101-
`create-nuxt-nightly` scaffolds with it, and `npm create nuxt@latest --nightly` scaffolds a project against the Nuxt nightly channel.
101+
`create-nuxt-nightly` scaffolds with it, and `npm create nuxt@latest -- --nightly` scaffolds a project against the Nuxt nightly channel.
102102

103103
Builds for an individual pull request are published by [pkg.pr.new](https://pkg.pr.new) and linked from the pull request itself, which is the quickest way to check whether a fix works before it is released.

docs/analyze.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ npx nuxt analyze [ROOTDIR] [--cwd=<directory>] [--logLevel=<silent|info|verbose>
1414
```
1515
<!--/analyze-cmd-->
1616

17-
The `analyze` command builds Nuxt and analyzes the production bundle (experimental). The results are served on a local server when the build finishes, unless you pass `--no-serve`.
17+
The `analyze` command builds Nuxt and analyzes the production bundle (experimental). The results are served on a local server when the build finishes, unless you pass `--no-serve` or `CI` is set in the environment.
1818

1919
Routes are not prerendered while analyzing, since prerendering runs the built app and its output is not what is being measured. Pass `--prerender` if your analysis needs it.
2020

docs/dev.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ npx nuxt dev [ROOTDIR] [--cwd=<directory>] [--logLevel=<silent|info|verbose>] [-
1414
```
1515
<!--/dev-cmd-->
1616

17-
The `dev` command starts a development server with hot module replacement at [http://localhost:3000](https://localhost:3000)
17+
The `dev` command starts a development server with hot module replacement at [http://localhost:3000](http://localhost:3000)
1818

1919
![nuxt dev](/capture/output/nuxt-dev-static.svg)
2020

@@ -65,7 +65,7 @@ The `dev` command starts a development server with hot module replacement at [ht
6565
| `--profile=<verbose>` | | Profile performance, writing a V8 CPU profile and a JSON report on exit. Use `--profile=verbose` for a full console report. |
6666
<!--/dev-opts-->
6767

68-
The port and host can also be set via `NUXT_PORT`, `PORT`, `NUXT_HOST` or `HOST` environment variables.
68+
The port and host can also be set via `NUXT_PORT`, `NITRO_PORT`, `PORT`, `NUXT_HOST`, `NITRO_HOST` or `HOST` environment variables.
6969

7070
This command sets `process.env.NODE_ENV` to `development`.
7171

@@ -126,8 +126,8 @@ The build timings, `perf-report.json` and `perf-trace.json` come from Nuxt's own
126126

127127
| Variable | Purpose |
128128
|---------------------------|----------------------------------------------------------------------|
129-
| `NUXT_PORT`, `PORT` | Port to listen on |
130-
| `NUXT_HOST`, `HOST` | Host to listen on |
129+
| `NUXT_PORT`, `NITRO_PORT`, `PORT` | Port to listen on |
130+
| `NUXT_HOST`, `NITRO_HOST`, `HOST` | Host to listen on |
131131
| `NUXT_TUI` | `1` to force the interactive UI on, `plain` to opt out |
132132
| `NUXT_TERM_THEME` | `light` or `dark`, when the terminal's background cannot be detected |
133133
| `NUXT_IGNORE_LOCK` | `1` to ignore a dev server already running for this project |

docs/init.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,13 @@ The `create-nuxt` command initializes a fresh Nuxt project using [unjs/giget](ht
5757
Without a terminal to prompt in, the answers it would have asked for have to be passed as arguments: the directory, `--template`, `--packageManager` and `--gitInit`. Anything missing is reported along with the available templates, and the command exits with `2`.
5858

5959
```bash [Terminal]
60-
npm create nuxt@latest my-app --template minimal --packageManager pnpm --no-gitInit
60+
npm create nuxt@latest my-app -- --template minimal --packageManager pnpm --no-gitInit
6161
```
6262

63+
::note
64+
The `--` is needed with `npm create`, which reads anything flag-shaped after the initializer as npm's own config and warns `Unknown cli config` instead of passing it on. Other package managers forward the whole command line as it is, so pass the flags to them directly: `pnpm create nuxt@latest my-app --template minimal`.
65+
::
66+
6367
## Environment Variables
6468

6569
- `NUXI_INIT_REGISTRY`: Set to a custom template registry. ([learn more](https://github.com/unjs/giget#custom-registry)).

0 commit comments

Comments
 (0)