Welcome to the installation guide for the AIT Lab Website project. This document will guide you through setting up the project on your local machine for development and testing.
Before you begin, ensure you have the following installed:
-
Node.js:
- Version 22.0.0 or higher is required.
- Download Node.js.
- Check your Node.js version with:
node -v
-
npm (Node Package Manager):
- Comes bundled with Node.js. Version 9.0.0 or higher is recommended.
- Verify your npm version with:
npm -v
-
Yarn (Preferred Package Manager):
- Install Yarn globally by running:
npm install --global yarn
- Verify Yarn installation:
yarn -v
- Install Yarn globally by running:
-
Git:
- Used to clone the repository.
- Download Git.
-
Code Editor (Optional):
- Visual Studio Code is recommended for a seamless development experience.
Clone the repository from GitHub to your local machine:
git clone https://github.com/Xatta-Trone/ait-lab-next.git
Change your working directory to the project folder:
cd ait-lab-next
Install the required dependencies. Use Yarn (preferred) or npm:
yarn install
npm install
Run the following command to start the development server:
yarn dev
npm run dev
The application will be accessible at http://localhost:3000.
Command | Yarn Command | npm Command | Description |
---|---|---|---|
Install | yarn install |
npm install |
Installs project dependencies. |
Start Development | yarn dev |
npm run dev |
Starts the development server. |
Build Production | yarn build |
npm run build |
Builds the project for production. |
Start Production | yarn start |
npm run start |
Starts the production server after a build. |
Lint | yarn lint |
npm run lint |
Runs ESLint to check for code quality and consistency. |
Generate Sitemap | yarn postbuild |
npm run postbuild |
Generates a sitemap using next-sitemap . |
- Error:
"Error: Unsupported engine"
- Solution: Ensure Node.js v22 is installed. Use nvm for managing Node.js versions:
nvm install 22 nvm use 22
- Error: Errors during
yarn install
ornpm install
- Solution: Clear the cache and reinstall:
- For Yarn:
yarn cache clean yarn install
- For npm:
npm cache clean --force npm install
- For Yarn:
- Error:
EADDRINUSE
on port 3000 - Solution: Specify a different port:
- For Yarn:
PORT=4000 yarn dev
- For npm:
PORT=4000 npm run dev
- For Yarn:
For deploying the application to production:
-
Build the project:
- Using Yarn:
yarn build
- Using npm:
npm run build
- Using Yarn:
-
Start the production server:
- Using Yarn:
yarn start
- Using npm:
npm run start
- Using Yarn:
If you encounter any issues not covered here, feel free to open an issue on the GitHub repository.
Happy coding! 🚀