Home >Web Front-end >JS Tutorial >#ow to setup Next-React on your local system.
To install React with Next.js using the npx create-next-app@latest command, follow these steps:
Before creating a Next.js project, you need to have Node.js installed on your system. Check if it's installed by running:
node -v
If you don't have it installed, download and install it from Node.js official website.
On Windows, open Command Prompt or PowerShell. On macOS or Linux, open a Terminal.
Use the cd command to navigate to the folder where you'd like to create your new project. For example:
cd path/to/your/project/folder
Now, run the following command:
npx create-next-app@latest
Once you've answered all the prompts, the command will install all the necessary dependencies and create the project files.
After the installation is complete, navigate to the folder of your new Next.js project:
cd my-next-app
Replace my-next-app with the actual name of your project.
To start the development server and see your new Next.js project in action, run:
npm run dev
By default, your project will be accessible at http://localhost:3000.
Open your project folder in your preferred code editor, such as VS Code:
code .
Now you have successfully created and set up a new Next.js (React) project!
The above is the detailed content of #ow to setup Next-React on your local system.. For more information, please follow other related articles on the PHP Chinese website!