What worked for me was uninstalling and reinstalling globally in command prompt
npm uninstall -g create-vite
npm install -g create-vite
But using npx instead of npm worked just as well