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