- Install Node.js v18.17.0 or higher, either by installing manually or using nvm (required by Gatsby v5)
- Install Gatsby CLI:
npm install -g gatsby-cli
If you have cloned this repo for the first time:
- Clone the repo and install node modules:
npm install --legacy-peer-deps
- Start the Gatsby dev server:
gatsby develop
- The site can be opened at
localhost:8000
- You can stop the Gatsby server with:
CTRL + C
If the repo already exists locally:
- Check your Node.js version and if necessary, update to v18.17.0 or higher, either by updating manually or using nvm (required by Gatsby v5)
- Delete the existing
node_modules
,.cache
, andpublic
folders in the repo's root directory - Delete the existing
package-lock.json
file - Install node modules with:
npm install --legacy-peer-deps
- Now the project is all set, you can start working with Gatsby commands
- Start the Gatsby dev server:
gatsby develop
- The site can be opened at
localhost:8000
- You can stop the Gatsby server with:
CTRL + C
- Build the project:
gatsby clean && gatsby build
- Serve the build:
gatsby serve
- The site can be opened at
localhost:9000
- The server build environment requires Node.js v18.17.0 or higher
- For node modules installation, the
npm install --legacy-peer-deps
command should be defined in the node modules install config - For cached fast builds, the
npm run build
command should be defined in the build config