I am deploying a mern app, the frontend is created using vite.js. When I was deploying it it gives an error that vite not found during the execution of npm run build command.
So how we can deploy the app which is created using vite.js?
here are my frontend package.json file scripts:
“scripts”: {
“dev”: “vite”,
“build”: “vite build”,
“lint”: “eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0”,
“preview”: “vite preview”
}
here are the logs of the process of deployment:
backend@1.0.0 build
Feb 24 02:18:23 AM> npm install && npm install --legacy-peer-deps --prefix frontend && npm run build --prefix frontend
Feb 24 02:18:26 AM>added 167 packages, and audited 168 packages in 3s
Feb 24 02:18:26 AM>18 packages are looking for funding
Feb 24 02:18:26 AM> run npm fund
for details
Feb 24 02:18:26 AM>found 0 vulnerabilities
Feb 24 02:18:36 AM>added 227 packages, and audited 228 packages in 9s
Feb 24 02:18:36 AM>10 packages are looking for funding
Feb 24 02:18:36 AM run npm fund
for details
Feb 24 02:18:36 AM1 moderate severity vulnerability
Feb 24 02:18:36 AM>To address all issues, run:
Feb 24 02:18:36 AM> npm audit fix
Feb 24 02:18:36 AM>Run npm audit
for details.
Feb 24 02:18:36 AM> chat-app@0.0.0 build
Feb 24 02:18:36 AM> vite build
Feb 24 02:18:36 AM>sh: 1: vite: not found
Feb 24 02:18:36 AM==> Build failed
Thanks