fix-postcss.sh 471 B

123456789101112131415161718192021
  1. #!/bin/bash
  2. # 删除 node_modules 和 lock 文件
  3. echo "清理旧依赖..."
  4. rm -rf node_modules package-lock.json unpackage/dist
  5. # 创建 .npmrc 文件配置
  6. echo "配置 npm..."
  7. cat > .npmrc << 'NPMRC'
  8. legacy-peer-deps=true
  9. engine-strict=false
  10. NPMRC
  11. # 安装依赖
  12. echo "开始安装依赖..."
  13. npm install --legacy-peer-deps
  14. # 检查 postcss 版本
  15. echo ""
  16. echo "=== 检查结果 ==="
  17. npm list postcss @vue/compiler-sfc | grep -E "(postcss|compiler-sfc)" | head -10