When creating a Next.js application in VS Code, I run the following command: "npx create-next-app@latest" and complete the process of creating the application. However, Next.js' website shows that I should have a "pages" and "styles" folders as well as an "app" and "public" folders. If I selected the wrong option or something, I'm not sure if this has to do with the "Do you want to use..." part when creating the app.
"Do you want to use..." section Top-level files and folders I see
I updated Node.js and re-created the application multiple times with different selections in the "Do you want to use..." section. I was hoping the folder would show up but no luck. I'm not sure where to go since I'm new to using Next.js.
When you create a new project using the latest
create-next-app
, it uses the recently releasedApp Routerdefault functionality. Therefore, your project contains theapp
directory, not thepages
.If you do not want to use App Router, you should answer "No" to "Use App Router (recommended)?" question. In this case, your project will contain the
pages
directory.