Generate a new NextJS project directory:
mkdir ${PROJECT_DIR}
cd ${PROJECT_DIR}
Initialize the directory:
npm init -y
Then, install the NextJS:
npm install --save react react-dom next
Genearte pages
directory in root:
mkdir pages
Then, modify "scripts"
in package.json
:
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "next build",
"start": "next start",
"start:dev": "next"
}
To start NextJS project as the Dev mode, run this command:
npm run start:dev
In this repo, below dependencies are needed:
npm install --save isomorphic-unfetch # fetch(network) module