In order to setup Next.js in a computer, we need MacOS, Windows or Linux installed in the machine. Also, we need Node.js to be installed.
If Node.js is installed, we can setup Next.js using below command.
npx create-next-app@latest
npx
is a NPM package executor. We can both download and run a package using npx
command. npx
is automatically available if your NPM version in your machine is v5.2.0 or higher.
Another package manager is yarn. Using the yarn
global command also, we can setup Next.js using:
yarn create next-app
If you are using pnpm, you can setup Next.js using:
pnpm create next-app
The setup process is interactive. Follow the instructions and you will get a project that has Next.js setup in it.