Files
metabuilder/frontends/codegen/sh/fix-node-modules.sh
2026-03-09 22:30:41 +00:00

36 lines
811 B
Bash
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/bash
# Fix Node Modules Script
# This script resolves common npm/Vite installation issues
set -e
echo "🔧 Fixing node_modules and dependencies..."
echo ""
# Step 1: Clean npm cache
echo "1⃣ Cleaning npm cache..."
npm cache clean --force
# Step 2: Remove node_modules
echo "2⃣ Removing node_modules..."
rm -rf node_modules
rm -rf package-lock.json
# Step 3: Remove workspace node_modules
echo "3⃣ Removing workspace node_modules..."
rm -rf packages/*/node_modules
# Step 4: Reinstall
echo "4⃣ Reinstalling dependencies..."
npm install
echo ""
echo "✅ Dependencies reinstalled successfully!"
echo ""
echo "You can now run:"
echo " npm run dev - Start development server"
echo " npm run build - Build for production"
echo " npm run lint - Run linter"
echo ""