Member-only story
How to create a Next.js project.
Run the `npx` command in Terminal.
npx create-next-app next_app
↓
If you see the following, you have succeeded
Success! Created next_app at ….
Perform basic operations on the created project.
- Start the development server and run the app.
npm run devrun dev
- Build the app and generate the finished app.
npm run build
- Run the finished app and check it works
npm start
Project structure
- Folders
.next
This folder is created when you run the project, not when you create it. The files of the web app generated from the project are saved in this folder.
node_modules
This folder contains the npm packages required by the project.
pages
Contains the contents of the web pages to be displayed.
public
A list of resources (image files, etc.) to be made public.