Add New Document

Add New Document

✅ 1. Open the Theme Folder

Go to the folder where you have downloaded or extracted yourVite.js theme/template:

cd path/to/your/vite-theme-folder
Example:
cd ~/Downloads/vite-theme-master

✅ 2. Check Node.js & npm Installation
Make sure Node.js and npm are installed on your system:
node -v
npm -v
If not installed, download and install from: https://nodejs.org

✅ 3. Install Dependencies

Most Vite projects come with apackage.jsonfile that lists all required dependencies.
Install them using:

npm install

yarn install
✅ 4. Start the Development Server
To run the theme locally, use:
npm run dev
yarn dev

This will start theVite development serverand open the app in your browser athttp://localhost:5173(or another port if already in use).

✅ 5. Build for Production (Optional)

If you want to build the theme for deployment:
npm run build
yarn build

This creates an optimized production build inside thebuild/folder.


📁 Important Files to Check

  • package.json – Contains scripts and dependencies
  • README.md – Usually has setup instructions
  • index.html – Main entry HTML file
  • vite.config.js – Vite configuration file
  • .env – Environment variables (if any)
 

❓ Common Issues & Fixes

Problem
Solution
npm ERR!
Runnpm cache clean --force
Missing Scripts
Make suredev,build, andpreviewscripts exist inpackage.json
No such file or directory
Double-check your current folder location
Port already in use
Close other apps or change port invite.config.jsor.env

📌 Example: Scripts in package.json

"scripts": {
  "dev": "vite",
  "build": "vite build",
  "preview": "vite preview"
}