(edited)
Hey everyone, I’m trying to deploy a Vue 3 + Vite project to Vercel. Locally everything works fine, but the build on Vercel fails with:
vbnet
sh: line 1: vite: command not foundError: Command "npm run build" exited with 127✅ What I’ve already tried:
viteis installed and works locally (npm run buildruns fine)viteis listed independencies(not justdevDependencies)- Using
npx vite buildasbuildCommand→ same error vercel.jsonlooks like this:
{ "buildCommand": "npm run build", "outputDirectory": "dist", "framework": "vite", "rewrites": [ { "source": "/((?!api|favicon\\.ico|robots\\.txt|.*\\.js|.*\\.css|.*\\.svg).*)", "destination": "/index.html" } ]}package.json{ "name": "vue-bewerbung", "version": "1.0.0", "private": true, "type": "module", "scripts": { "dev": "vite", "build": "vite build", "preview": "vite preview" }, "dependencies": { "pdfjs-dist": "^5.1.91", "pdfobject": "^2.3.1", "vue": "^3.5.13", "vue-router": "^4.5.0", "vite": "^6.3.5", "@vitejs/plugin-vue": "^5.2.2", "autoprefixer": "^10.4.21", "postcss": "^8.5.3", "tailwindcss": "^3.4.17" }, "engines": { "node": "20.x" }}