To install Next.js, you need to have Node.js installed on your machine.
Check the node version installed in your machine, to check run node -v in your terminal
Installation
The recommended installation of Next.js is to use npx create-next-app@latest
command. This will install all the necessary files and set up everything.
npx create-next-app@latest
![](https://www.nucleiotechnologies.com/wp-content/uploads/2022/02/image-83-1024x496.png)
![](https://www.nucleiotechnologies.com/wp-content/uploads/2022/02/image-84-1024x325.png)
If you want to use typescript, add –typescript after the command.
npx create-next-app@latest --typescript
After the installation is complete, cd to your project and run these commands
npm install
npm run dev
![](https://www.nucleiotechnologies.com/wp-content/uploads/2022/02/image-85-1024x177.png)
![](https://www.nucleiotechnologies.com/wp-content/uploads/2022/02/image-86-1024x213.png)
Go to localhost:3000
![](https://www.nucleiotechnologies.com/wp-content/uploads/2022/02/image-87-1024x576.png)
Problems in installation
- “Failed to load next.config.js”
Check the version of node installed in your machine. I use the latest version 16.14.0. It is important to use 12.22.0 or higher version
![](https://www.nucleiotechnologies.com/wp-content/uploads/2022/02/image-88.png)