Skip to main content
0 reactions

How to Create a Next.js App with create-next-app

A dark indigo card titled Create a Next.js App, labelled Next.js How-To, with the line With create-next-app and its recommended defaults, beside a terminal window with four ticked lines: create-next-app 16.4.6, TypeScript and Tailwind, 0 vulnerabilities, localhost:3000.
How to create a Next.js app with create-next-app.

create-next-app is Next.js’s own setup tool: one command creates a working Next.js project with TypeScript, Tailwind CSS and the App Router. This guide creates a Next.js app with create-next-app and its recommended defaults, then starts it in the browser.

The short answer: run npx create-next-app@latest my-app, choose Yes, use recommended defaults, then cd my-app and npm run dev, and open http://localhost:3000.

Syntax

SyntaxBash
npx create-next-app@latest <project-name> [options]
  • npx runs a tool from npm without installing it.
  • create-next-app@latest: the newest version of the setup tool.
  • <project-name>: the name of the new project and of its folder.
  • [options]: optional settings, such as --biome instead of ESLint, --src-dir for a src folder, or --yes to accept the defaults without questions. With no options, it asks whether to use the recommended defaults.

The reference: create-next-app (opens in a new tab) in the Next.js documentation, and the tool’s own help, npx create-next-app@latest --help.

Prerequisites

Step 1: Create the App

Open Terminal (PowerShell on Windows) in the folder where you keep your projects, and run:

TerminalBash
npx create-next-app@latest my-app

The first time, npx asks to install create-next-app: type y. Then create-next-app asks Would you like to use the recommended Next.js defaults? Press Return to choose Yes, use recommended defaults. It creates the project and installs its packages (your folder path will differ):

OutputPlain text
npm notice run npx
✔ Would you like to use the recommended Next.js defaults? › Yes, use recommended defaults
Creating a new Next.js app in /Users/user/my-app.

Using npm.

Initializing project with template: app-tw


Installing dependencies:
- next
- react
- react-dom

Installing devDependencies:
- @tailwindcss/turbopack
- @types/node
- @types/react
- @types/react-dom
- eslint
- eslint-config-next
- tailwindcss
- typescript

⠹
npm warn deprecated eslint@9.39.5: This version is no longer supported. Please see https://eslint.org/version-support for other options.

added 359 packages, and audited 360 packages in 23s

146 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

npm notice run my-app@0.1.0 npx
npm notice run 'next' typegen
Generating route types...
✓ Types generated successfully

Initialized a git repository.

Success! Created my-app at /Users/user/my-app

The npm warn deprecated eslint@9.39.5 line is a warning, not an error: the app works. Fixed: npm warn deprecated eslint@9.39.5 in a New Next.js App (opens in a new tab) explains it.

Step 2: Start the App

Move into the new folder and start the app in development mode:

TerminalBash
cd my-app
TerminalBash
npm run dev
OutputPlain text
npm notice run my-app@0.1.0 dev
npm notice run next dev
▲ Next.js 16.4.6 (Turbopack)
- Local:         http://localhost:3000
- Network:       http://192.168.x.x:3000
✓ Ready in 263ms
✓ Running next.config.ts took 93ms
- Cache Components enabled
- Partial Prefetching enabled
- Experiments (use with caution):
  ✓ agentFeedback

agentFeedback under Experiments is one of the recommended defaults: create-next-app describes it as preparing anonymized Next.js feedback for your review. Turn it off with experimental.agentFeedback: false in next.config.ts.

Open http://localhost:3000 in your browser. Next.js’s start page shows that the app runs:

The Next.js start page in a browser: the Next.js logo, the heading To get started, edit the page.tsx file, and the buttons Deploy Now and Documentation.
The new app’s start page.

Clean Up When You’re Done

  1. Press Ctrl+C in the Terminal to stop the app.
  2. If the app was only a test, delete the my-app folder.

Troubleshooting

FAQ

Can I skip the question?

Yes. Any option on the command line, or --yes, makes create-next-app use the defaults without asking.

TypeScript, ESLint, Tailwind CSS and the App Router, with Cache Components, an AGENTS.md file and agentFeedback switched on. npx create-next-app@latest --help lists every option and its default.

Conclusion

npx create-next-app@latest my-app with the recommended defaults gives you a working Next.js app; npm run dev starts it at http://localhost:3000.

Additional Resources

Next.js and other names mentioned are trademarks of their respective owners. JD Bots isn’t affiliated with or endorsed by Vercel.

0 comments