Instala nvm:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
Cierra y reabre tu terminal
Instala Node.js:
nvm install --lts
Ahora podrás instalar paquetes globales sin sudo:
npm install -g live-server
npx live-server
python3 -m http.server 8000
Instala Vite localmente en tu proyecto:
npm install vite --save-dev
Crea un script en tu package.json
:
{
"scripts": {
"dev": "vite",
"build": "vite build"
}
}
Ejecuta:
npm run dev