If you're getting a "can't locate file" error when running npm run dev, follow these steps:
- Download and install Node.js from nodejs.org
- Version 16 or higher is required
Before running the dev server, you MUST install dependencies first:
npm installThis will download all the required packages from the package.json file.
After dependencies are installed, you can start the dev server:
npm run devThe server will start and show you the URL (usually http://localhost:5173/ or similar). The browser should open automatically.
- Solution: Run
npm installfirst
- Solution: The server will automatically use a different port (like 5174, 5175, etc.)
- Solution: Make sure you ran
npm installto get the@tailwindcss/postcsspackage
- Delete the
node_modulesfolder - Delete
package-lock.json(if it exists) - Run
npm installagain - Run
npm run dev
Make sure these files exist in your project root:
package.json✓index.html✓vite.config.js✓tailwind.config.js✓postcss.config.js✓src/main.js✓
If you're still having issues, check that:
- You're in the correct directory (where
package.jsonis located) - You have internet connection (for downloading dependencies)
- You have the latest version of Node.js