I need to create a NextJS project for a Udemy course, but I need it to be NextJS version 12 instead of the latest version.
How can I do that?
It's possible to setup Next.js version 12 manually:
# init the package.json
npm init
# intall next dependencies
npm install [email protected] react react-dom
// edit your package.json with next scripts
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
}
# create the file structure
.
├── package.json
├── pages
│ ├── index.js
// init your index.js
import React from "react";
function index() {
return <div>Hello world</div>;
}
export default index;
# start next
npm run dev
Use the following commands (taken from here), replacing <app-name> with your actual app:
npx create-next-app@12 <app-name> && cd <app-name> && npm i next@12
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With