vite is not recognized, try to npm install vite --save dev in devdependies and then try first to build locally by using the command : npm run build
Case 2: check you build scripts it has to vite build to do so. If it not correct it.
Conclusion : If it is work in locally and probably work at deployment also.
Happy coding...