Next.js Create Your First Next.js App
The setup tool builds a whole Next.js app in one command. It asks a few questions, and each answer shapes the app.
Start the setup tool
The command names the app my-bookshelf. Without flags, it stops to ask the setup questions.
npx create-next-app@latest my-bookshelfThe new app folder, listed
The setup tool built the folder and its files. The app folder holds the pages.
cd my-bookshelf
lsExample
npx create-next-app@16.4.6 my-bookshelf --typescript --tailwind --eslint --app --src-dir=false --turbopack --import-alias "@/*"Key points
- create-next-app: the setup tool that builds a new Next.js app
- TypeScript: the typed form of JavaScript. Answer yes, so the app uses .tsx files.
- Tailwind: the styling tool. Answer yes, so the app ships with Tailwind styles.
- App Router: the current router. Answer yes, so the app uses the app folder.
- Turbopack: the fast bundler. Answer yes, so the dev server starts fast.
- The flags below answer the questions in advance, so the command runs without stopping to ask.
In this example, the command builds the app in one run. The flags answer the setup questions in advance: TypeScript yes, Tailwind yes, ESLint yes, App Router yes, no src folder, Turbopack on, and @ as the import shortcut. The last two lines are the proof. Types generated, and the app folder was created. The path in the last line is this machine folder, and your own path will show your own folder.
Note
The app name becomes the folder name. This course names the app my-bookshelf.
Try it Yourself
Edit the code, then press Run.
Running is simulated · TypeScript Playground
Exercise
What does the --typescript flag choose?