As of december 2022 you need node version 14.6 or later to run NextJS.
Automatic installation
yarn create next-app my-app-name --typescriptcd my-app-name
yarn dev - Starts development server on localhost:3000yarn build - builds the application for production usageyarn start - starts a Next.js production serverWhat we will get is
- Automatic compilation and bundling (with webpack and babel)
- React Fast Refresh
- Static generation and server-side rendering of
./pages/ - Static file serving. Everything in
./public/is mapped to/
Manual installation
For a manual setup have a look at the official docs page.
Installation using Nx
// add the next plugin onceyarn add --dev @nrwl/next
// create a new nextJs appnx g @nrwl/next:app my-new-app
// create a new nextJs pagenx g @nrwl/next:page my-new-page --project=my-new-app
// create a new nextJs componentnx g @nrwl/next:component my-new-component --project=my-new-appFind more commands on the Nx NextJS plugin doc page.