#Getting started
1 messages · Page 1 of 1 (latest)
Hi @scarlet flint. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
To get started with Next.js, you can follow these steps:
- Install
create-next-app: The easiest way to create a new Next.js application is by usingcreate-next-app. This CLI tool sets up everything for you. To get started, run one of the following commands:
npx create-next-app@latest
# or
yarn create next-app
# or
pnpm create next-app
You will be asked a series of prompts to configure your project. Answer them accordingly, and a new project will be created with the correct configuration based on your answers.
- Manual Installation: If you prefer to manually create a new Next.js app, install the required packages:
npm install next@latest react@latest react-dom@latest
Then, open package.json and add the following scripts:
{
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
}
}
These scripts correspond to different stages of developing an application:
dev: runsnext devto start Next.js in development mode.build: runsnext buildto build the application for production usage.start: runsnext startto start a Next.js production server.lint: runsnext lintto set up Next.js' built-in ESLint configuration.
- TypeScript: If you want to set up a TypeScript project with Next.js, you can use the
create-next-appcommand with the--example with-typescriptflag:
npx create-next-app --example with-typescript my-stripe-project && cd my-stripe-project
# or
yarn create next-app --example with-typescript my-stripe-project && cd my-stripe-project
This will create a pre-configured Next.js TypeScript project.
For more information, refer to the following sources:
- Next.js Getting Started (https://nextjs.org/docs/getting-started)
- Create Next App (https://nextjs.org/docs/app/api-reference/create-next-app)
- Manual Installation (https://nextjs.org/docs/getting-started/installation)
- TypeScript Setup (https://vercel.com/guides/getting-started-with-nextjs-typescript-stripe)