diff --git a/docs/01-getting-started/01-installation.mdx b/docs/01-getting-started/01-installation.mdx index ef2e91afa15af..130bd4e5b97f2 100644 --- a/docs/01-getting-started/01-installation.mdx +++ b/docs/01-getting-started/01-installation.mdx @@ -15,7 +15,7 @@ System Requirements: ## Automatic Installation -We recommend starting a new Next.js app using [`create-next-app`](/docs/app/api-reference/create-next-app), which sets up everything automatically for you. To create a project, run: +We recommend starting a new Next.js app using [`create-next-app`](/docs/app/api-reference/cli/create-next-app), which sets up everything automatically for you. To create a project, run: ```bash filename="Terminal" npx create-next-app@latest @@ -35,7 +35,7 @@ Would you like to customize the import alias (`@/*` by default)? No / Yes What import alias would you like configured? @/* ``` -After the prompts, [`create-next-app`](/docs/app/api-reference/create-next-app) will create a folder with your project name and install the required dependencies. +After the prompts, [`create-next-app`](/docs/app/api-reference/cli/create-next-app) will create a folder with your project name and install the required dependencies. If you're new to Next.js, see the [project structure](/docs/getting-started/project-structure) docs for an overview of all the possible files and folders in your application. @@ -67,10 +67,10 @@ Open your `package.json` file and add the following `scripts`: These scripts refer to the different stages of developing an application: -- `dev`: runs [`next dev`](/docs/app/api-reference/next-cli#development) to start Next.js in development mode. -- `build`: runs [`next build`](/docs/app/api-reference/next-cli#build) to build the application for production usage. -- `start`: runs [`next start`](/docs/app/api-reference/next-cli#production) to start a Next.js production server. -- `lint`: runs [`next lint`](/docs/app/api-reference/next-cli#lint) to set up Next.js' built-in ESLint configuration. +- `dev`: runs [`next dev`](/docs/app/api-reference/cli/next#next-dev-options) to start Next.js in development mode. +- `build`: runs [`next build`](/docs/app/api-reference/cli/next#next-build-options) to build the application for production usage. +- `start`: runs [`next start`](/docs/app/api-reference/cli/next#next-start-options) to start a Next.js production server. +- `lint`: runs [`next lint`](/docs/app/api-reference/cli/next#next-lint-options) to set up Next.js' built-in ESLint configuration. ### Creating directories diff --git a/docs/02-app/01-building-your-application/06-optimizing/11-static-assets.mdx b/docs/02-app/01-building-your-application/06-optimizing/11-static-assets.mdx index 9212cc09cc13f..4955ea32a37a3 100644 --- a/docs/02-app/01-building-your-application/06-optimizing/11-static-assets.mdx +++ b/docs/02-app/01-building-your-application/06-optimizing/11-static-assets.mdx @@ -47,4 +47,4 @@ For static metadata files, such as `robots.txt`, `favicon.ico`, etc, you should > Good to know: > > - The directory must be named `public`. The name cannot be changed and it's the only directory used to serve static assets. -> - Only assets that are in the `public` directory at [build time](/docs/app/api-reference/next-cli#build) will be served by Next.js. Files added at request time won't be available. We recommend using a third-party service like [Vercel Blob](https://vercel.com/docs/storage/vercel-blob?utm_source=next-site&utm_medium=docs&utm_campaign=next-website) for persistent file storage. +> - Only assets that are in the `public` directory at [build time](/docs/app/api-reference/cli/next#next-build-options) will be served by Next.js. Files added at request time won't be available. We recommend using a third-party service like [Vercel Blob](https://vercel.com/docs/storage/vercel-blob?utm_source=next-site&utm_medium=docs&utm_campaign=next-website) for persistent file storage. diff --git a/docs/02-app/01-building-your-application/07-configuring/02-eslint.mdx b/docs/02-app/01-building-your-application/07-configuring/02-eslint.mdx index e626340a09604..5b0b63d34b380 100644 --- a/docs/02-app/01-building-your-application/07-configuring/02-eslint.mdx +++ b/docs/02-app/01-building-your-application/07-configuring/02-eslint.mdx @@ -200,7 +200,7 @@ The `next/core-web-vitals` rule set is enabled when `next lint` is run for the f `next/core-web-vitals` updates `eslint-plugin-next` to error on a number of rules that are warnings by default if they affect [Core Web Vitals](https://web.dev/vitals/). -> The `next/core-web-vitals` entry point is automatically included for new applications built with [Create Next App](/docs/app/api-reference/create-next-app). +> The `next/core-web-vitals` entry point is automatically included for new applications built with [Create Next App](/docs/app/api-reference/cli/create-next-app). ### TypeScript diff --git a/docs/02-app/02-api-reference/05-next-config-js/exportPathMap.mdx b/docs/02-app/02-api-reference/05-next-config-js/exportPathMap.mdx index be454aaf42141..87fa7c3870f87 100644 --- a/docs/02-app/02-api-reference/05-next-config-js/exportPathMap.mdx +++ b/docs/02-app/02-api-reference/05-next-config-js/exportPathMap.mdx @@ -15,7 +15,7 @@ description: Customize the pages that will be exported as HTML files when using -`exportPathMap` allows you to specify a mapping of request paths to page destinations, to be used during export. Paths defined in `exportPathMap` will also be available when using [`next dev`](/docs/app/api-reference/next-cli#development). +`exportPathMap` allows you to specify a mapping of request paths to page destinations, to be used during export. Paths defined in `exportPathMap` will also be available when using [`next dev`](/docs/app/api-reference/cli/next#next-dev-options). Let's start with an example, to create a custom `exportPathMap` for an app with the following pages: diff --git a/docs/02-app/02-api-reference/06-cli/create-next-app.mdx b/docs/02-app/02-api-reference/06-cli/create-next-app.mdx new file mode 100644 index 0000000000000..8bd3260587874 --- /dev/null +++ b/docs/02-app/02-api-reference/06-cli/create-next-app.mdx @@ -0,0 +1,85 @@ +--- +title: create-next-app +description: Create Next.js apps using one command with the create-next-app CLI. +--- + +{/* The content of this doc is shared between the app and pages router. You can use the `Content` component to add content that is specific to the Pages Router. Any shared content should not be wrapped in a component. */} + +The `create-next-app` CLI allow you to quickly create a new Next.js application using the default template or an [example](https://github.com/vercel/next.js/tree/canary/examples) from a public Github repository. It is the easiest way to get started with Next.js. + +Basic usage: + +```bash filename="Terminal" +npx create-next-app@latest [project-name] [options] +``` + +## Reference + +The following options are available: + +| Options | Description | +| --------------------------------------- | --------------------------------------------------------------- | +| `-h` or `--help` | Show all available options | +| `-v` or `--version` | Output the version number | +| `--no-*` | Negate default options. E.g. `--no-eslint` | +| `--ts` or `--typescript` | Initialize as a TypeScript project (default) | +| `--js` or `--javascript` | Initialize as a JavaScript project | +| `--tailwind` | Initialize with Tailwind CSS config (default) | +| `--eslint` | Initialize with ESLint config | +| `--app` | Initialize as an App Router project | +| `--src-dir` | Initialize inside a `src/` directory | +| `--turbo` | Enable Turbopack by default for development | +| `--import-alias ` | Specify import alias to use (default "@/\*") | +| `--empty` | Initialize an empty project | +| `--use-npm` | Explicitly tell the CLI to bootstrap the application using npm | +| `--use-pnpm` | Explicitly tell the CLI to bootstrap the application using pnpm | +| `--use-yarn` | Explicitly tell the CLI to bootstrap the application using Yarn | +| `--use-bun` | Explicitly tell the CLI to bootstrap the application using Bun | +| `-e` or `--example [name] [github-url]` | An example to bootstrap the app with | +| `--example-path ` | Specify the path to the example separately | +| `--reset-preferences` | Explicitly tell the CLI to reset any stored preferences | +| `--skip-install` | Explicitly tell the CLI to skip installing packages | +| `--yes` | Use previous preferences or defaults for all options | + +## Examples + +## With the default template + +To create a new app using the default template, run the following command in your terminal: + +```bash filename="Terminal" +npx create-next-app@latest +``` + +You will then be asked the following prompts: + +```txt filename="Terminal" +What is your project named? my-app +Would you like to use TypeScript? No / Yes +Would you like to use ESLint? No / Yes +Would you like to use Tailwind CSS? No / Yes +Would you like your code inside a `src/` directory? No / Yes +Would you like to use App Router? (recommended) No / Yes +Would you like to use Turbopack for `next dev`? No / Yes +Would you like to customize the import alias (`@/*` by default)? No / Yes +``` + +Once you've answered the prompts, a new project will be created with your chosen configuration. + +## With an official Next.js example + +To create a new app using an official Next.js example, use the `--example` flag with the following command: + +```bash filename="Terminal" +npx create-next-app@latest --example [your-project-name] [example-name] +``` + +You can view a list of all available examples along with setup instructions in the [Next.js repository](https://github.com/vercel/next.js/tree/canary/examples). + +## With any public Github example + +To create a new app using any public Github example, use the `--example` option with the Github repo's URL. For example: + +```bash filename="Terminal" +npx create-next-app@latest --example [your-project-name] "https://github.com/.../" +``` diff --git a/docs/02-app/02-api-reference/06-cli/index.mdx b/docs/02-app/02-api-reference/06-cli/index.mdx new file mode 100644 index 0000000000000..f66eb21ea66c4 --- /dev/null +++ b/docs/02-app/02-api-reference/06-cli/index.mdx @@ -0,0 +1,11 @@ +--- +title: CLI +description: API Reference for the Next.js Command Line Interface (CLI) tools. +--- + +{/* The content of this doc is shared between the app and pages router. You can use the `Content` component to add content that is specific to the Pages Router. Any shared content should not be wrapped in a component. */} + +Next.js comes with **two** Command Line Interface (CLI) tools: + +- **`create-next-app`**: Quickly create a new Next.js application using the default template or an [example](https://github.com/vercel/next.js/tree/canary/examples) from a public Github repository. +- **`next`**: Run the Next.js development server, build your application, and more. diff --git a/docs/02-app/02-api-reference/06-cli/next.mdx b/docs/02-app/02-api-reference/06-cli/next.mdx new file mode 100644 index 0000000000000..196668d83a78d --- /dev/null +++ b/docs/02-app/02-api-reference/06-cli/next.mdx @@ -0,0 +1,238 @@ +--- +title: next CLI +description: Learn how to run and build your application with the Next.js CLI. +--- + +{/* The content of this doc is shared between the app and pages router. You can use the `Content` component to add content that is specific to the Pages Router. Any shared content should not be wrapped in a component. */} + +The Next.js CLI allows you to develop, build, start your application, and more. + +Basic usage: + +```bash filename="Terminal" +npm run next [command] [options] +``` + +## Reference + +The following options are available: + +| Options | Description | +| ------------------- | ---------------------------------- | +| `-h` or `--help` | Shows all available options | +| `-v` or `--version` | Outputs the Next.js version number | + +### Commands + +The following commands are available: + +| Command | Description | +| ------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [`dev`](#next-dev-options) | Starts Next.js in development mode with Hot Module Reloading, error reporting, and more. | +| [`build`](#next-build-options) | Creates an optimized production build of your application. Displaying information about each route. | +| [`start`](#next-start-options) | Starts Next.js in production mode. The application should be compiled with `next build` first. | +| [`info`](next-info-options) | Prints relevant details about the current system which can be used to report Next.js bugs. | +| [`lint`](next-lint-options) | Runs ESLint for all files in the `/src`, `/app`, `/pages`, `/components`, and `/lib` directories. It also provides a guided setup to install any required dependencies if ESLint it is not already configured in your application. | +| [`telemetry`](next-telemetry-options) | Allows you to enable or disable Next.js' completely anonymous telemetry collection. | + +> **Good to know**: Running `next` without a command is an alias for `next dev`. + +### `next dev` options + +`next dev` starts the application in development mode with Hot Module Reloading (HMR), error reporting, and more. The following options are available when running `next dev`: + +| Option | Description | +| ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | +| `-h, --help` | Show all available options. | +| `[directory]` | A directory in which to build the application. If not provided, current directory is used. | +| `--turbo` | Starts development mode using [Turbopack](https://nextjs.org/docs/architecture/turbopack). | +| `-p` or `--port ` | Specify a port number on which to start the application. Default: 3000, env: PORT | +| `-H`or `--hostname ` | Specify a hostname on which to start the application. Useful for making the application available for other devices on the network. Default: 0.0.0.0 | +| `--experimental-https` | Starts the server with HTTPS and generates a self-signed certificate. | +| `--experimental-https-key ` | Path to a HTTPS key file. | +| `--experimental-https-cert ` | Path to a HTTPS certificate file. | +| `--experimental-https-ca ` | Path to a HTTPS certificate authority file. | +| `--experimental-upload-trace ` | Reports a subset of the debugging trace to a remote HTTP URL. | + +### `next build` options + +`next build` creates an optimized production build of your application. The output displays information about each route. For example: + +```bash filename="Terminal" +Route (app) Size First Load JS +┌ ○ /_not-found 0 B 0 kB +└ ƒ /products/[id] 0 B 0 kB + +○ (Static) prerendered as static content +ƒ (Dynamic) server-rendered on demand +``` + +- **Size**: The size of assets downloaded when navigating to the page client-side. The size for each route only includes its dependencies. +- **First Load JS**: The size of assets downloaded when visiting the page from the server. The amount of JS shared by all is shown as a separate metric. + +Both of these values are [**compressed with gzip**](/docs/app/api-reference/next-config-js/compress). The first load is indicated by green, yellow, or red. Aim for green for performant applications. + +The following options are available for the `next build` command: + +| Option | Description | +| ---------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | +| `-h, --help` | Show all available options. | +| `[directory]` | A directory on which to build the application. If not provided, the current directory will be used. | +| `-d` or `--debug` | Enables a more verbose build output. With this flag enabled additional build output like rewrites, redirects, and headers will be shown. | +| | +| `--profile` | Enables production [profiling for React](https://react.dev/reference/react/Profiler). | +| `--no-lint` | Disables linting. | +| `--no-mangling` | Disables [mangling](https://en.wikipedia.org/wiki/Name_mangling). This may affect performance and should only be used for debugging purposes. | +| `--experimental-app-only` | Builds only App Router routes. | +| `--experimental-build-mode [mode]` | Uses an experimental build mode. (choices: "compile", "generate", default: "default") | + +### `next start` options + +`next start` starts the application in production mode. The application should be compiled with [`next build`](#next-build-options) first. + +The following options are available for the `next start` command: + +| Option | Description | +| --------------------------------------- | --------------------------------------------------------------------------------------------------------------- | +| `-h` or `--help` | Show all available options. | +| `[directory]` | A directory on which to start the application. If no directory is provided, the current directory will be used. | +| `-p` or `--port ` | Specify a port number on which to start the application. (default: 3000, env: PORT) | +| `-H` or `--hostname ` | Specify a hostname on which to start the application (default: 0.0.0.0). | +| `--keepAliveTimeout ` | Specify the maximum amount of milliseconds to wait before closing the inactive connections. | + +### `next info` options + +`next info` prints relevant details about the current system which can be used to report Next.js bugs when opening a [GitHub issue](https://github.com/vercel/next.js/issues). This information includes Operating System platform/arch/version, Binaries (Node.js, npm, Yarn, pnpm), package versions (`next`, `react`, `react-dom`), and more. + +The output should look like this: + +```bash filename="Terminal" +Operating System: + Platform: darwin + Arch: arm64 + Version: Darwin Kernel Version 23.6.0 + Available memory (MB): 65536 + Available CPU cores: 10 +Binaries: + Node: 20.12.0 + npm: 10.5.0 + Yarn: 1.22.19 + pnpm: 9.6.0 +Relevant Packages: + next: 15.0.0-canary.115 // Latest available version is detected (15.0.0-canary.115). + eslint-config-next: 14.2.5 + react: 19.0.0-rc + react-dom: 19.0.0 + typescript: 5.5.4 +Next.js Config: + output: N/A +``` + +The following options are available for the `next info` command: + +| Option | Description | +| ---------------- | ---------------------------------------------- | +| `-h` or `--help` | Show all available options | +| `--verbose` | Collects additional information for debugging. | + +### `next lint` options + +`next lint` runs ESLint for all files in the `pages/`, `app/`, `components/`, `lib/`, and `src/` directories. It also provides a guided setup to install any required dependencies if ESLint is not already configured in your application. + +The following options are available for the `next lint` command: + +| Option | Description | +| ----------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | +| `[directory]` | A base directory on which to lint the application. If not provided, the current directory will be used. | +| `-d, --dir, ` | Include directory, or directories, to run ESLint. | +| `--file, ` | Include file, or files, to run ESLint. | +| `--ext, [exts...]` | Specify JavaScript file extensions. (default: [".js", ".mjs", ".cjs", ".jsx", ".ts", ".mts", ".cts", ".tsx"]) | +| `-c, --config, ` | Uses this configuration file, overriding all other configuration options. | +| `--resolve-plugins-relative-to, ` | Specify a directory where plugins should be resolved from. | +| `--strict` | Creates a `.eslintrc.json` file using the Next.js strict configuration. | +| `--rulesdir, ` | Uses additional rules from this directory(s). | +| `--fix` | Automatically fix linting issues. | +| `--fix-type ` | Specify the types of fixes to apply (e.g., problem, suggestion, layout). | +| `--ignore-path ` | Specify a file to ignore. | +| `--no-ignore ` | Disables the `--ignore-path` option. | +| `--quiet` | Reports errors only. | +| `--max-warnings [maxWarnings]` | Specify the number of warnings before triggering a non-zero exit code. (default: -1) | +| `-o, --output-file, ` | Specify a file to write report to. | +| `-f, --format, ` | Uses a specific output format. | +| `--no-inline-config` | Prevents comments from changing config or rules. | +| `--report-unused-disable-directives-severity ` | Specify severity level for unused eslint-disable directives. (choices: "error", "off", "warn") | +| `--no-cache` | Disables caching. | +| `--cache-location, ` | Specify a location for cache. | +| `--cache-strategy, [cacheStrategy]` | Specify a strategy to use for detecting changed files in the cache. (default: "metadata") | +| `--error-on-unmatched-pattern` | Reports errors when any file patterns are unmatched. | +| `-h, --help` | Displays this message. | + +### `next telemetry` options + +Next.js collects **completely anonymous** telemetry data about general usage. Participation in this anonymous program is optional, and you can opt-out if you prefer not to share information. + +The following options are available for the `next telemetry` command: + +| Option | Description | +| ------------ | --------------------------------------- | +| `-h, --help` | Show all available options. | +| `--enable` | Enables Next.js' telemetry collection. | +| `--disable` | Disables Next.js' telemetry collection. | + +Learn more about [Telemetry](/telemetry). + +## Examples + +### Changing the default port + +By default, Next.js uses `http://localhost:3000` during development and with `next start`. The default port can be changed with the `-p` option, like so: + +```bash filename="Terminal" +next dev -p 4000 +``` + +Or using the `PORT` environment variable: + +```bash filename="Terminal" +PORT=4000 next dev +``` + +> **Good to know**: `PORT` cannot be set in `.env` as booting up the HTTP server happens before any other code is initialized. + +### Using HTTPS during development + +For certain use cases like webhooks or authentication, it may be required to use HTTPS to have a secure environment on `localhost`. Next.js can generate a self-signed certificate with `next dev` using the `--experimental-https` flag: + +```bash filename="Terminal" +next dev --experimental-https +``` + +You can also provide a custom certificate and key with `--experimental-https-key` and `--experimental-https-cert`. Optionally, you can provide a custom CA certificate with `--experimental-https-ca` as well. + +```bash filename="Terminal" +next dev --experimental-https --experimental-https-key ./certificates/localhost-key.pem --experimental-https-cert ./certificates/localhost.pem +``` + +`next dev --experimental-https` is only intended for development and creates a locally trusted certificate with [`mkcert`](https://github.com/FiloSottile/mkcert). In production, use properly issued certificates from trusted authorities. + +> **Good to know**: When deploying to Vercel, HTTPS is [automatically configured](https://vercel.com/docs/security/encryption) for your Next.js application. + +### Configuring a timeout for downstream proxies + +When deploying Next.js behind a downstream proxy (e.g. a load-balancer like AWS ELB/ALB), it's important to configure Next's underlying HTTP server with [keep-alive timeouts](https://nodejs.org/api/http.html#http_server_keepalivetimeout) that are _larger_ than the downstream proxy's timeouts. Otherwise, once a keep-alive timeout is reached for a given TCP connection, Node.js will immediately terminate that connection without notifying the downstream proxy. This results in a proxy error whenever it attempts to reuse a connection that Node.js has already terminated. + +To configure the timeout values for the production Next.js server, pass `--keepAliveTimeout` (in milliseconds) to `next start`, like so: + +```bash filename="Terminal" +next start --keepAliveTimeout 70000 +``` + +### Passing Node.js arguments + +You can pass any [node arguments](https://nodejs.org/api/cli.html#cli_node_options_options) to `next` commands. For example: + +```bash filename="Terminal" +NODE_OPTIONS='--throw-deprecation' next +NODE_OPTIONS='-r esm' next +NODE_OPTIONS='--inspect' next +``` diff --git a/docs/02-app/02-api-reference/06-create-next-app.mdx b/docs/02-app/02-api-reference/06-create-next-app.mdx deleted file mode 100644 index c394a55a9954a..0000000000000 --- a/docs/02-app/02-api-reference/06-create-next-app.mdx +++ /dev/null @@ -1,149 +0,0 @@ ---- -title: create-next-app -description: Create Next.js apps in one command with create-next-app. ---- - -{/* The content of this doc is shared between the app and pages router. You can use the `Content` component to add content that is specific to the Pages Router. Any shared content should not be wrapped in a component. */} - -The easiest way to get started with Next.js is by using `create-next-app`. This CLI tool enables you to quickly start building a new Next.js application, with everything set up for you. - -You can create a new app using the default Next.js template, or by using one of the [official Next.js examples](https://github.com/vercel/next.js/tree/canary/examples). - -### Interactive - -You can create a new project interactively by running: - -```bash filename="Terminal" -npx create-next-app@latest -``` - -```bash filename="Terminal" -yarn create next-app -``` - -```bash filename="Terminal" -pnpm create next-app -``` - -```bash filename="Terminal" -bun create next-app -``` - -You will then be asked the following prompts: - -```txt filename="Terminal" -What is your project named? my-app -Would you like to use TypeScript? No / Yes -Would you like to use ESLint? No / Yes -Would you like to use Tailwind CSS? No / Yes -Would you like your code inside a `src/` directory? No / Yes -Would you like to use App Router? (recommended) No / Yes -Would you like to use Turbopack for `next dev`? No / Yes -Would you like to customize the import alias (`@/*` by default)? No / Yes -``` - -Once you've answered the prompts, a new project will be created with the correct configuration depending on your answers. - -### Non-interactive - -You can also pass command line arguments to set up a new project non-interactively. - -Further, you can negate default options by prefixing them with `--no-` (e.g. `--no-eslint`). - -See `create-next-app --help`: - -```bash filename="Terminal" -Usage: create-next-app [project-directory] [options] - -Options: - -V, --version output the version number - --ts, --typescript - - Initialize as a TypeScript project. (default) - - --js, --javascript - - Initialize as a JavaScript project. - - --tailwind - - Initialize with Tailwind CSS config. (default) - - --eslint - - Initialize with ESLint config. - - --app - - Initialize as an App Router project. - - --src-dir - - Initialize inside a `src/` directory. - - --turbo - - Enable Turbopack by default for development. - - --import-alias - - Specify import alias to use (default "@/*"). - - --empty - - Initialize an empty project. - - --use-npm - - Explicitly tell the CLI to bootstrap the application using npm - - --use-pnpm - - Explicitly tell the CLI to bootstrap the application using pnpm - - --use-yarn - - Explicitly tell the CLI to bootstrap the application using Yarn - - --use-bun - - Explicitly tell the CLI to bootstrap the application using Bun - - -e, --example [name]|[github-url] - - An example to bootstrap the app with. You can use an example name - from the official Next.js repo or a GitHub URL. The URL can use - any branch and/or subdirectory - - --example-path - - In a rare case, your GitHub URL might contain a branch name with - a slash (e.g. bug/fix-1) and the path to the example (e.g. foo/bar). - In this case, you must specify the path to the example separately: - --example-path foo/bar - - --reset-preferences - - Explicitly tell the CLI to reset any stored preferences - - --skip-install - - Explicitly tell the CLI to skip installing packages - - --yes - - Use previous preferences or defaults for all options that were not - explicitly specified, without prompting. - - -h, --help display help for command -``` - -### Why use Create Next App? - -`create-next-app` allows you to create a new Next.js app within seconds. It is officially maintained by the creators of Next.js, and includes a number of benefits: - -- **Interactive Experience**: Running `npx create-next-app@latest` (with no arguments) launches an interactive experience that guides you through setting up a project. -- **Zero Dependencies**: Initializing a project is as quick as one second. Create Next App has zero dependencies. -- **Offline Support**: Create Next App will automatically detect if you're offline and bootstrap your project using your local package cache. -- **Support for Examples**: Create Next App can bootstrap your application using an example from the Next.js examples collection (e.g. `npx create-next-app --example api-routes`) or any public GitHub repository. -- **Tested**: The package is part of the Next.js monorepo and tested using the same integration test suite as Next.js itself, ensuring it works as expected with every release. diff --git a/docs/02-app/02-api-reference/08-next-cli.mdx b/docs/02-app/02-api-reference/08-next-cli.mdx deleted file mode 100644 index 6ab9bb65b5461..0000000000000 --- a/docs/02-app/02-api-reference/08-next-cli.mdx +++ /dev/null @@ -1,436 +0,0 @@ ---- -title: Next.js CLI -description: Learn how the Next.js CLI allows you to develop, build, and start your application, and more. ---- - -{/* The content of this doc is shared between the app and pages router. You can use the `Content` component to add content that is specific to the Pages Router. Any shared content should not be wrapped in a component. */} - -The Next.js CLI allows you to develop, build, start your application, and more. - -To get a list of the available CLI commands, run the following command inside your project directory: - -```bash filename="Terminal" -next -h -``` - -The output should look like this: - -```bash filename="Terminal" -Usage next [options] [command] - -The Next.js CLI allows you to develop, build, start your application, and more. - -Options: - -v, --version Outputs the Next.js version. - -h, --help Displays this message. - -Commands: - build [directory] [options] Creates an optimized production build of your application. - The output displays information about each route. - dev [directory] [options] Starts Next.js in development mode with hot-code reloading, - error reporting, and more. - info [options] Prints relevant details about the current system which can be - used to report Next.js bugs. - lint [directory] [options] Runs ESLint for all files in the `/src`, `/app`, `/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. - start [directory] [options] Starts Next.js in production mode. The application should be - compiled with `next build` first. - telemetry [options] Allows you to enable or disable Next.js' completely - anonymous telemetry collection. -``` - -You can pass any [node arguments](https://nodejs.org/api/cli.html#cli_node_options_options) to `next` commands: - -```bash filename="Terminal" -NODE_OPTIONS='--throw-deprecation' next -NODE_OPTIONS='-r esm' next -NODE_OPTIONS='--inspect' next -``` - -> **Good to know**: Running `next` without a command is the same as running `next dev` - -## Development - -`next dev` starts the application in development mode with hot-code reloading, error reporting, and more. - -To get a list of the available options with `next dev`, run the following command inside your project directory: - -```bash filename="Terminal" -next dev -h -``` - -The output should look like this: - -```bash filename="Terminal" -Usage: next dev [directory] [options] - -Starts Next.js in development mode with hot-code reloading, error reporting, and more. - -Arguments: - [directory] A directory on which to build the application. - If no directory is provided, the current - directory will be used. - -Options: - --turbo Starts development mode using Turbopack (beta). - -p, --port Specify a port number on which to start the - application. (default: 3000, env: PORT) - -H, --hostname Specify a hostname on which to start the - application (default: 0.0.0.0). - --experimental-https Starts the server with HTTPS and generates a - self-signed certificate. - --experimental-https-key, Path to a HTTPS key file. - --experimental-https-cert, Path to a HTTPS certificate file. - --experimental-https-ca, Path to a HTTPS certificate authority file. - --experimental-upload-trace, Reports a subset of the debugging trace to a - remote HTTP URL. Includes sensitive data. - -h, --help Displays this message. -``` - -The application will start at `http://localhost:3000` by default. The default port can be changed with `-p`, like so: - -```bash filename="Terminal" -next dev -p 4000 -``` - -Or using the `PORT` environment variable: - -```bash filename="Terminal" -PORT=4000 next dev -``` - -> **Good to know**: -> -> - `PORT` cannot be set in `.env` as booting up the HTTP server happens before any other code is initialized. -> - Next.js will automatically retry with another port until a port is available if a port is not specified with the CLI option `--port` or the `PORT` environment variable. - -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: - -```bash filename="Terminal" -next dev -H 192.168.1.2 -``` - -### Turbopack - -[Turbopack](/docs/architecture/turbopack) (beta), our new bundler, which is being tested and stabilized in Next.js, helps speed up local iterations while working on your application. - -To use Turbopack in development mode, add the `--turbo` option: - -```bash filename="Terminal" -next dev --turbo -``` - -### HTTPS for Local Development - -For certain use cases like webhooks or authentication, it may be required to use HTTPS to have a secure environment on `localhost`. Next.js can generate a self-signed certificate with `next dev` as follows: - -```bash filename="Terminal" -next dev --experimental-https -``` - -You can also provide a custom certificate and key with `--experimental-https-key` and `--experimental-https-cert`. Optionally, you can provide a custom CA certificate with `--experimental-https-ca` as well. - -```bash filename="Terminal" -next dev --experimental-https --experimental-https-key ./certificates/localhost-key.pem --experimental-https-cert ./certificates/localhost.pem -``` - -`next dev --experimental-https` is only intended for development and creates a locally-trusted certificate with `mkcert`. In production, use properly issued certificates from trusted authorities. When deploying to Vercel, HTTPS is [automatically configured](https://vercel.com/docs/security/encryption) for your Next.js application. - -## Build - -`next build` creates an optimized production build of your application. The output displays information about each route: - -```bash filename="Terminal" -Route (app) Size First Load JS -┌ ○ / 5.3 kB 89.5 kB -├ ○ /_not-found 885 B 85.1 kB -└ ○ /about 137 B 84.4 kB -+ First Load JS shared by all 84.2 kB - ├ chunks/184-d3bb186aac44da98.js 28.9 kB - ├ chunks/30b509c0-f3503c24f98f3936.js 53.4 kB - └ other shared chunks (total) - - -○ (Static) prerendered as static content -``` - -- **Size**: The number of assets downloaded when navigating to the page client-side. The size for each route only includes its dependencies. -- **First Load JS**: The number of assets downloaded when visiting the page from the server. The amount of JS shared by all is shown as a separate metric. - -Both of these values are [**compressed with gzip**](/docs/app/api-reference/next-config-js/compress). The first load is indicated by green, yellow, or red. Aim for green for performant applications. - -To get a list of the available options with `next build`, run the following command inside your project directory: - -```bash filename="Terminal" -next build -h -``` - -The output should look like this: - -```bash filename="Terminal" -Usage: next build [directory] [options] - -Creates an optimized production build of your application. The output displays information -about each route. - -Arguments: - [directory] A directory on which to build the application. If no - provided, the current directory will be - used. - -Options: - -d, --debug Enables a more verbose build output. - --profile Enables production profiling for React. - --no-lint Disables linting. - --no-mangling Disables mangling. - --experimental-app-only Builds only App Router routes. - --experimental-build-mode [mode] Uses an experimental build mode. (choices: "compile" - "generate", default: "default") - -h, --help Displays this message. -``` - -### Debug - -You can enable more verbose build output with the `--debug` flag in `next build`. - -```bash filename="Terminal" -next build --debug -``` - -With this flag enabled additional build output like rewrites, redirects, and headers will be shown. - -### Linting - -You can disable linting for builds like so: - -```bash filename="Terminal" -next build --no-lint -``` - -### Mangling - -You can disable [mangling](https://en.wikipedia.org/wiki/Name_mangling) for builds like so: - -```bash filename="Terminal" -next build --no-mangling -``` - -> **Good to know**: This may affect performance and should only be used for debugging purposes. - -### Profiling - -You can enable production profiling for React with the `--profile` flag in `next build`. - -```bash filename="Terminal" -next build --profile -``` - -After that, you can use the profiler in the same way as you would in development. - -## Production - -`next start` starts the application in production mode. The application should be compiled with [`next build`](#build) first. - -To get a list of the available options with `next start`, run the follow command inside your project directory: - -```bash filename="Terminal" -next start -h -``` - -The output should look like this: - -```bash filename="Terminal" -Usage: next start [directory] [options] - -Starts Next.js in production mode. The application should be compiled with `next build` -first. - -Arguments: - [directory] A directory on which to start the application. - If not directory is provided, the current - directory will be used. - -Options: - -p, --port Specify a port number on which to start the - application. (default: 3000, env: PORT) - -H, --hostname Specify a hostname on which to start the - application (default: 0.0.0.0). - --keepAliveTimeout Specify the maximum amount of milliseconds to wait - before closing the inactive connections. - -h, --help Displays this message. -``` - -The application will start at `http://localhost:3000` by default. The default port can be changed with `-p`, like so: - -```bash filename="Terminal" -next start -p 4000 -``` - -Or using the `PORT` environment variable: - -```bash filename="Terminal" -PORT=4000 next start -``` - -> **Good to know**: -> -> - `PORT` cannot be set in `.env` as booting up the HTTP server happens before any other code is initialized. -> - `next start` cannot be used with `output: 'standalone'` or `output: 'export'`. - -### Keep Alive Timeout - -When deploying Next.js behind a downstream proxy (e.g. a load-balancer like AWS ELB/ALB) it's important to configure Next's underlying HTTP server with [keep-alive timeouts](https://nodejs.org/api/http.html#http_server_keepalivetimeout) that are _larger_ than the downstream proxy's timeouts. Otherwise, once a keep-alive timeout is reached for a given TCP connection, Node.js will immediately terminate that connection without notifying the downstream proxy. This results in a proxy error whenever it attempts to reuse a connection that Node.js has already terminated. - -To configure the timeout values for the production Next.js server, pass `--keepAliveTimeout` (in milliseconds) to `next start`, like so: - -```bash filename="Terminal" -next start --keepAliveTimeout 70000 -``` - -## Info - -`next info` prints relevant details about the current system which can be used to report Next.js bugs. -This information includes Operating System platform/arch/version, Binaries (Node.js, npm, Yarn, pnpm) and npm package versions (`next`, `react`, `react-dom`). - -To get a list of the available options with `next info`, run the following command inside your project directory: - -```bash filename="Terminal" -next info -h -``` - -The output should look like this: - -```bash filename="Terminal" -Usage: next info [options] - -Prints relevant details about the current system which can be used to report Next.js bugs. - -Options: - --verbose Collections additional information for debugging. - -h, --help Displays this message. -``` - -Running `next info` will give you information like this example: - -```bash filename="Terminal" - -Operating System: - Platform: linux - Arch: x64 - Version: #22-Ubuntu SMP Fri Nov 5 13:21:36 UTC 2021 - Available memory (MB): 31795 - Available CPU cores: 16 -Binaries: - Node: 16.13.0 - npm: 8.1.0 - Yarn: 1.22.17 - pnpm: 6.24.2 -Relevant Packages: - next: 14.1.1-canary.61 // Latest available version is detected (14.1.1-canary.61). - react: 18.2.0 - react-dom: 18.2.0 -Next.js Config: - output: N/A - -``` - -This information should then be pasted into GitHub Issues. - -You can also run `next info --verbose` which will print additional information about the system and the installation of packages related to `next`. - -## Lint - -`next lint` runs ESLint for all files in the `pages/`, `app/`, `components/`, `lib/`, and `src/` directories. It also -provides a guided setup to install any required dependencies if ESLint is not already configured in -your application. - -To get a list of the available options with `next lint`, run the following command inside your project directory: - -```bash filename="Terminal" -next lint -h -``` - -The output should look like this: - -```bash filename="Terminal" -Usage: next lint [directory] [options] - -Runs ESLint for all files in the `/src`, `/app`, `/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. - -Arguments: - [directory] A base directory on which to lint the application. - If no directory is provided, the current directory - will be used. - -Options: - -d, --dir, Include directory, or directories, to run ESLint. - --file, Include file, or files, to run ESLint. - --ext, [exts...] Specify JavaScript file extensions. (default: - [".js", ".mjs", ".cjs", ".jsx", ".ts", ".mts", ".cts", ".tsx"]) - -c, --config, Uses this configuration file, overriding all other - configuration options. - --resolve-plugins-relative-to, Specify a directory where plugins should be resolved - from. - --strict Creates a `.eslintrc.json` file using the Next.js - strict configuration. - --rulesdir, Uses additional rules from this directory(s). - --fix Automatically fix linting issues. - --fix-type Specify the types of fixes to apply (e.g., problem, - suggestion, layout). - --ignore-path Specify a file to ignore. - --no-ignore Disables the `--ignore-path` option. - --quiet Reports errors only. - --max-warnings [maxWarnings] Specify the number of warnings before triggering a - non-zero exit code. (default: -1) - -o, --output-file, Specify a file to write report to. - -f, --format, Uses a specifc output format. - --no-inline-config Prevents comments from changing config or rules. - --report-unused-disable-directives-severity Specify severity level for unused eslint-disable - directives. (choices: "error", "off", "warn") - --no-cache Disables caching. - --cache-location, Specify a location for cache. - --cache-strategy, [cacheStrategy] Specify a strategy to use for detecting changed files - in the cache. (default: "metadata") - --error-on-unmatched-pattern Reports errors when any file patterns are unmatched. - -h, --help Displays this message. -``` - -If you have other directories that you would like to lint, you can specify them using the `--dir` flag: - -```bash filename="Terminal" -next lint --dir utils -``` - -For more information on the other options, check out our [ESLint](/docs/app/building-your-application/configuring/eslint) configuration documentation. - -## Telemetry - -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. - -To get a list of the available options with `next telemetry`, run the following command in your project directory: - -```bash filename="Terminal" -next telemetry -h -``` - -The output should look like this: - -```bash filename="Terminal" -Usage: next telemetry [options] - -Allows you to enable or disable Next.js' completely anonymous telemetry collection. - -Options: - --enable Enables Next.js' telemetry collection. - --disable Disables Next.js' telemetry collection. - -h, --help Displays this message. - -Learn more: https://nextjs.org/telemetry -``` - -Learn more about [Telemetry](/telemetry/). diff --git a/docs/03-pages/01-building-your-application/03-data-fetching/04-incremental-static-regeneration.mdx b/docs/03-pages/01-building-your-application/03-data-fetching/04-incremental-static-regeneration.mdx index bb2b6aedec0b2..40f5b5cfa2497 100644 --- a/docs/03-pages/01-building-your-application/03-data-fetching/04-incremental-static-regeneration.mdx +++ b/docs/03-pages/01-building-your-application/03-data-fetching/04-incremental-static-regeneration.mdx @@ -126,7 +126,7 @@ export default async function handler(req, res) { ### Testing on-Demand ISR during development -When running locally with `next dev`, `getStaticProps` is invoked on every request. To verify your on-demand ISR configuration is correct, you will need to create a [production build](/docs/pages/api-reference/next-cli#build) and start the [production server](/docs/pages/api-reference/next-cli#production): +When running locally with `next dev`, `getStaticProps` is invoked on every request. To verify your on-demand ISR configuration is correct, you will need to create a [production build](/docs/pages/api-reference/cli/next#next-build-options) and start the [production server](/docs/pages/api-reference/cli/next#next-start-options): ```bash filename="Terminal" $ next build diff --git a/docs/03-pages/01-building-your-application/06-configuring/13-debugging.mdx b/docs/03-pages/01-building-your-application/06-configuring/13-debugging.mdx index 915fd735209c7..dcf49ab467d1b 100644 --- a/docs/03-pages/01-building-your-application/06-configuring/13-debugging.mdx +++ b/docs/03-pages/01-building-your-application/06-configuring/13-debugging.mdx @@ -48,7 +48,7 @@ Create a file named `.vscode/launch.json` at the root of your project with the f `npm run dev` can be replaced with `yarn dev` if you're using Yarn or `pnpm dev` if you're using pnpm. -If you're [changing the port number](/docs/pages/api-reference/next-cli#development) your application starts on, replace the `3000` in `http://localhost:3000` with the port you're using instead. +If you're [changing the port number](/docs/pages/api-reference/cli/next#next-dev-options) your application starts on, replace the `3000` in `http://localhost:3000` with the port you're using instead. If you're running Next.js from a directory other than root (for example, if you're using Turborepo) then you need to add `cwd` to the server-side and full stack debugging tasks. For example, `"cwd": "${workspaceFolder}/apps/web"`. diff --git a/docs/03-pages/02-api-reference/06-edge.mdx b/docs/03-pages/02-api-reference/05-edge.mdx similarity index 100% rename from docs/03-pages/02-api-reference/06-edge.mdx rename to docs/03-pages/02-api-reference/05-edge.mdx diff --git a/docs/03-pages/02-api-reference/06-cli/create-next-app.mdx b/docs/03-pages/02-api-reference/06-cli/create-next-app.mdx new file mode 100644 index 0000000000000..fc95de3c6eb96 --- /dev/null +++ b/docs/03-pages/02-api-reference/06-cli/create-next-app.mdx @@ -0,0 +1,7 @@ +--- +title: CLI +description: Create Next.js apps using one command with the create-next-app CLI. +source: app/api-reference/cli/create-next-app +--- + +{/* DO NOT EDIT. The content of this doc is generated from the source above. To edit the content of this page, navigate to the source page in your editor. You can use the `Content` component to add content that is specific to the Pages Router. Any shared content should not be wrapped in a component. */} diff --git a/docs/03-pages/02-api-reference/04-create-next-app.mdx b/docs/03-pages/02-api-reference/06-cli/index.mdx similarity index 73% rename from docs/03-pages/02-api-reference/04-create-next-app.mdx rename to docs/03-pages/02-api-reference/06-cli/index.mdx index 526b85f346219..b343c5925c977 100644 --- a/docs/03-pages/02-api-reference/04-create-next-app.mdx +++ b/docs/03-pages/02-api-reference/06-cli/index.mdx @@ -1,7 +1,7 @@ --- -title: create-next-app -description: create-next-app -source: app/api-reference/create-next-app +title: CLI +description: API Reference for the Next.js Command Line Interface (CLI) tools. +source: app/api-reference/cli --- {/* DO NOT EDIT. The content of this doc is generated from the source above. To edit the content of this page, navigate to the source page in your editor. You can use the `Content` component to add content that is specific to the Pages Router. Any shared content should not be wrapped in a component. */} diff --git a/docs/03-pages/02-api-reference/05-next-cli.mdx b/docs/03-pages/02-api-reference/06-cli/next.mdx similarity index 72% rename from docs/03-pages/02-api-reference/05-next-cli.mdx rename to docs/03-pages/02-api-reference/06-cli/next.mdx index b2a171358327f..f4863058bc41f 100644 --- a/docs/03-pages/02-api-reference/05-next-cli.mdx +++ b/docs/03-pages/02-api-reference/06-cli/next.mdx @@ -1,7 +1,7 @@ --- -title: Next.js CLI -description: Next.js CLI -source: app/api-reference/next-cli +title: next CLI +description: Learn how to run and build your application with the Next.js CLI. +source: app/api-reference/cli/next --- {/* DO NOT EDIT. The content of this doc is generated from the source above. To edit the content of this page, navigate to the source page in your editor. You can use the `Content` component to add content that is specific to the Pages Router. Any shared content should not be wrapped in a component. */} diff --git a/errors/export-image-api.mdx b/errors/export-image-api.mdx index b2682cd43b2d7..273e65c3ed485 100644 --- a/errors/export-image-api.mdx +++ b/errors/export-image-api.mdx @@ -12,7 +12,7 @@ This is because Next.js optimizes images on-demand, as users request them (not a ## Possible Ways to Fix It -- Use [`next start`](/docs/pages/api-reference/next-cli#production) to run a server, which includes the Image Optimization API. +- Use [`next start`](/docs/pages/api-reference/cli/next#next-start-options) to run a server, which includes the Image Optimization API. - Use any provider which supports Image Optimization (such as [Vercel](https://vercel.com)). - [Configure `loader`](/docs/pages/api-reference/components/image#loader) in `next.config.js`. - [Configure `unoptimized`](/docs/pages/api-reference/components/image#unoptimized) in `next.config.js`. diff --git a/errors/export-no-custom-routes.mdx b/errors/export-no-custom-routes.mdx index 7fc0d4c61624f..840ba66846a54 100644 --- a/errors/export-no-custom-routes.mdx +++ b/errors/export-no-custom-routes.mdx @@ -11,7 +11,7 @@ These configs do not apply when exporting your Next.js application manually. ## Possible Ways to Fix It - Remove `rewrites`, `redirects`, and `headers` from your `next.config.js` to disable these features or -- Remove `output: 'export'` (or `next export`) in favor of [`next start`](/docs/pages/api-reference/next-cli#production) to run a production server +- Remove `output: 'export'` (or `next export`) in favor of [`next start`](/docs/pages/api-reference/cli/next#next-start-options) to run a production server ## Useful Links diff --git a/errors/export-no-i18n.mdx b/errors/export-no-i18n.mdx index bd79044f9c08d..de6f094a14ef8 100644 --- a/errors/export-no-i18n.mdx +++ b/errors/export-no-i18n.mdx @@ -9,7 +9,7 @@ In your `next.config.js` you defined `i18n`, along with `output: 'export'` (or y ## Possible Ways to Fix It - Remove `i18n` from your `next.config.js` to disable Internationalization or -- Remove `output: 'export'` (or `next export`) in favor of [`next start`](/docs/pages/api-reference/next-cli#production) to run a production server +- Remove `output: 'export'` (or `next export`) in favor of [`next start`](/docs/pages/api-reference/cli/next#next-start-options) to run a production server ## Useful Links diff --git a/errors/invalid-project-dir-casing.mdx b/errors/invalid-project-dir-casing.mdx index bdfedbd9774fb..544ed5d90b668 100644 --- a/errors/invalid-project-dir-casing.mdx +++ b/errors/invalid-project-dir-casing.mdx @@ -14,5 +14,5 @@ Ensure the casing for the current working directory matches the actual case of t ## Useful Links -- [Next.js CLI documentation](/docs/pages/api-reference/next-cli) +- [Next.js CLI documentation](/docs/pages/api-reference/cli/next) - [Case sensitivity in filesystems](https://en.wikipedia.org/wiki/Case_sensitivity#In_filesystems) diff --git a/packages/create-next-app/templates/app-empty/js/README-template.md b/packages/create-next-app/templates/app-empty/js/README-template.md index f27322c2fd382..6dcb9034239bc 100644 --- a/packages/create-next-app/templates/app-empty/js/README-template.md +++ b/packages/create-next-app/templates/app-empty/js/README-template.md @@ -1,4 +1,4 @@ -This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/create-next-app). +This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app). ## Getting Started diff --git a/packages/create-next-app/templates/app-empty/ts/README-template.md b/packages/create-next-app/templates/app-empty/ts/README-template.md index 90f181fe120aa..f06471ae3a82b 100644 --- a/packages/create-next-app/templates/app-empty/ts/README-template.md +++ b/packages/create-next-app/templates/app-empty/ts/README-template.md @@ -1,4 +1,4 @@ -This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/create-next-app). +This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app). ## Getting Started diff --git a/packages/create-next-app/templates/app-tw-empty/js/README-template.md b/packages/create-next-app/templates/app-tw-empty/js/README-template.md index f27322c2fd382..6dcb9034239bc 100644 --- a/packages/create-next-app/templates/app-tw-empty/js/README-template.md +++ b/packages/create-next-app/templates/app-tw-empty/js/README-template.md @@ -1,4 +1,4 @@ -This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/create-next-app). +This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app). ## Getting Started diff --git a/packages/create-next-app/templates/app-tw-empty/ts/README-template.md b/packages/create-next-app/templates/app-tw-empty/ts/README-template.md index 90f181fe120aa..f06471ae3a82b 100644 --- a/packages/create-next-app/templates/app-tw-empty/ts/README-template.md +++ b/packages/create-next-app/templates/app-tw-empty/ts/README-template.md @@ -1,4 +1,4 @@ -This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/create-next-app). +This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app). ## Getting Started diff --git a/packages/create-next-app/templates/app-tw/ts/README-template.md b/packages/create-next-app/templates/app-tw/ts/README-template.md index 234c6d154f643..e215bc4ccf138 100644 --- a/packages/create-next-app/templates/app-tw/ts/README-template.md +++ b/packages/create-next-app/templates/app-tw/ts/README-template.md @@ -1,4 +1,4 @@ -This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/create-next-app). +This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app). ## Getting Started diff --git a/packages/create-next-app/templates/app/js/README-template.md b/packages/create-next-app/templates/app/js/README-template.md index 6410399e647f8..09a8a4d2c4ead 100644 --- a/packages/create-next-app/templates/app/js/README-template.md +++ b/packages/create-next-app/templates/app/js/README-template.md @@ -1,4 +1,4 @@ -This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/create-next-app). +This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app). ## Getting Started diff --git a/packages/create-next-app/templates/app/ts/README-template.md b/packages/create-next-app/templates/app/ts/README-template.md index 234c6d154f643..e215bc4ccf138 100644 --- a/packages/create-next-app/templates/app/ts/README-template.md +++ b/packages/create-next-app/templates/app/ts/README-template.md @@ -1,4 +1,4 @@ -This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/create-next-app). +This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app). ## Getting Started