How to setup Next JS project
Next.Js ยท Web Development

How to setup Next JS project

Aashish Kasma|December 1, 2022|1 Minute read|Listen
Next.JsWeb Development
TL;DR

A short, precise walkthrough for setting up a new Next.js project, from the Node.js and npm prerequisites through the commands that scaffold and run it.

To set up a Next.js project, you will need to have Node.js and npm (the Node.js package manager) installed on your machine.

Here are the steps to set up a new Next.js project:

  • Open a terminal window and navigate to the directory where you want to create your project.
  • Run the following command to create a new Next.js project:

npx create-next-app my-app

  • This will create a new directory called "my-app" with the basic file structure for a Next.js app.
  • Change into the new directory:

cd my-app

  • Run the following command to install the dependencies for your project:

npm install

  • Once the dependencies have been installed, you can start the development server by running the following command:

npm run dev

This will start the development server, and your app will be available at http://localhost:3000/. As you make changes to your code, the development server will automatically reload the page to reflect your changes.

That's it! You now have a working Next.js project. You can start building your app by editing the files in the "pages" directory.

SHARE

Aashish Kasma
Aashish Kasma
Co-founder & CTO, Lucent Innovation
linkedinmediumdevtohashnode

Facing a Challenge? Let's Talk.

Whether it's AI, data engineering, or commerce tell us what's not working yet. Our team will respond within 1 business day.

Start the Conversation