So we are working on this project of a website using MERN stack with mongodb but everytime i tried running the code that my friend provides me it gives this error. Checked the vite dependencies but no luck so I am gonna drop the list of dependencies here.
The error:
PS C:UsersshishOneDriveDesktopWorking codes30 Sept codes24 Sep 2024virtualr-main> npm run dev
> [email protected] dev
> vite
failed to load config from C:UsersshishOneDriveDesktopWorking codes30 Sept codes24 Sep 2024virtualr-mainvite.config.js
error when starting dev server:
Error: ENOENT: no such file or directory, open 'C:UsersshishOneDriveDesktopWorking codes30 Sept codes24 Sep 2024virtualr-mainnode_modulesreact-refreshcjsreact-refresh-runtime.development.js'
at Object.readFileSync (node:fs:448:20)
at file:///C:/Users/shish/OneDrive/Desktop/Working%20codes/30%20Sept%20codes/24%20Sep%202024/virtualr-main/node_modules/@vitejs/plugin-react/dist/index.mjs:17:6
at ModuleJob.run (node:internal/modules/esm/module_job:222:25)
at async ModuleLoader.import (node:internal/modules/esm/loader:316:24)
at async loadConfigFromBundledFile (file:///C:/Users/shish/OneDrive/Desktop/Working%20codes/30%20Sept%20codes/24%20Sep%202024/virtualr-main/node_modules/vite/dist/node/chunks/dep-CDnG8rE7.js:66634:15)
at async loadConfigFromFile (file:///C:/Users/shish/OneDrive/Desktop/Working%20codes/30%20Sept%20codes/24%20Sep%202024/virtualr-main/node_modules/vite/dist/node/chunks/dep-CDnG8rE7.js:66475:24)
at async resolveConfig (file:///C:/Users/shish/OneDrive/Desktop/Working%20codes/30%20Sept%20codes/24%20Sep%202024/virtualr-main/node_modules/vite/dist/node/chunks/dep-CDnG8rE7.js:66083:24)
at async _createServer (file:///C:/Users/shish/OneDrive/Desktop/Working%20codes/30%20Sept%20codes/24%20Sep%202024/virtualr-main/node_modules/vite/dist/node/chunks/dep-CDnG8rE7.js:62701:18)
at async CAC.<anonymous> (file:///C:/Users/shish/OneDrive/Desktop/Working%20codes/30%20Sept%20codes/24%20Sep%202024/virtualr-main/node_modules/vite/dist/node/cli.js:735:20)
Package.json:
{
"name": "virtualr",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"lint": "eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview"
},
"dependencies": {
"@emotion/react": "^11.13.0",
"@emotion/styled": "^11.13.0",
"@google/generative-ai": "^0.17.0",
"@mui/icons-material": "^5.16.7",
"@mui/material": "^5.16.7",
"axios": "^1.7.3",
"bcryptjs": "^2.4.3",
"bootstrap": "^5.3.3",
"chart.js": "^4.4.4",
"chartjs-plugin-datalabels": "^2.2.0",
"chatgpt-api": "^0.0.6",
"express": "^4.19.2",
"html2canvas": "^1.4.1",
"jsonwebtoken": "^9.0.2",
"jspdf": "^2.5.1",
"lucide-react": "^0.344.0",
"mongoose": "^8.5.2",
"react": "^18.2.0",
"react-chartjs-2": "^5.2.0",
"react-dom": "^18.2.0",
"react-hook-form": "^7.52.2",
"react-hot-toast": "^2.4.1",
"react-router-dom": "^6.26.1"
},
"devDependencies": {
"@types/react": "^18.2.56",
"@types/react-dom": "^18.2.19",
"@vitejs/plugin-react": "^4.2.1",
"autoprefixer": "^10.4.18",
"daisyui": "^4.12.10",
"eslint": "^8.56.0",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.5",
"postcss": "^8.4.35",
"tailwindcss": "^3.4.1",
"vite": "^5.1.4"
}
}
Tried everything that generically comes on web or gpt but getting these error continuously. Want the solution to run my code.