There are two ways to install Next.js 12 on Windows 10. One is automatic and the second is manual. We will be installing through automatic setup which is easy and recommended by the Next.js official team.
The latest stable version of Next.js is 12. To set up and install it on Windows 10 make sure that you have installed Node.js and its version should be 12.22.0 or later. To install node.js on Windows 10 follow this tutorial.
Next, run the following command into the terminal,
pnpm create next-app
In case, you don’t have pnpm installed then it would return an error “pnpm: command not found”. To install pnpm run the following command
npm install -g pnpm
Once pnpm is installed successfully, run the first command, which creates the Next.js app. It will ask you for the project name which can be anything. If the project name has more than one word then it is better to add hyphens between to make it readable. Sometimes, it takes a few seconds to complete it.
After following these steps, you should have Next.js 12 installed with the latest version on your Windows 10.
Run the below command into the git bash terminal to check out the installed Next.js version
npx next -v
It would return the version of your Next.js app, following is an example response,
There is one more way to check out the version which is the package.json file. Next.js keeps the package.json file in the root directory and contains a JSON array. In the array, the next object value shows the version which you can find under the dependencies array.
To run the Next.js app in the browser, open git bash and run the below command
npm run dev
This command starts the development server. Once the command run, go to the browser and open the following link
The development server serves the Next.js app on this URL.