First, let’s make sure that your development environment is ready.
If you are on Windows, we recommend downloading Git for Windows and use Git Bash that comes with it, which supports the UNIX-specific commands in this tutorial.
To create a Next.js app, open your terminal,
cd into the directory you’d like to create the app in, and run the following command:
npm init next-app nextjs-blog --example "https://github.com/vercel/next-learn-starter/tree/master/learn-starter"
Under the hood, this uses the tool called
create-next-app, which bootstraps a Next.js app for you. It uses this template through the
If it doesn’t work, please take a look at this page.
You now have a new directory called
cd into it:
Then, run the following command:
npm run dev
This starts your Next.js app’s "development server" (more on this later) on port 3000.
Let’s check to see if it’s working. Open http://localhost:3000 from your browser.
Question: What text do you see on the page?