Nextjs Installation
Installation
To install Next.js, you'll first need to have Node.js and npm (Node Package Manager) installed on your machine.
Create a Next.js App
$ npx create-next-app@latest <dir>
Tip : Don't forget to follow node manager's naming conventions.
On installation, you'll see the following prompts:
$ 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 to use `src/` directory? No / Yes
$ Would you like to use App Router? (recommended) No / Yes
$ Would you like to customize the default import alias (@/*)? No / Yes
$ What import alias would you like configured? @/*
After the prompts, `create-next-app` will create a folder with your project name and install the required dependencies.
Scripts :
- -
dev: runsnext devto start development server. - -
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's built-in ESLint configuration.
Run Development Server
- Run
npm run devto start the development server. - Visit
http://localhost:3000to view your application. - Edit
app/page.tsx(orpages/index.tsx) file and save it to see the updated result in your browser.