diff --git a/install.sh b/install.sh index f69a370..66aabc7 100644 --- a/install.sh +++ b/install.sh @@ -1103,13 +1103,11 @@ install_backend_dependencies() { npm config set registry https://registry.npmmirror.com fi - # 设置npm使用Python3 - npm config set python python3 print_info "正在安装依赖包(包含数据库native模块,可能需要几分钟)..." # 安装依赖,捕获错误 - if npm install --production; then + if PYTHON=python3 npm install --production; then print_success "后端依赖安装完成" else print_error "依赖安装失败" @@ -2024,8 +2022,6 @@ update_install_dependencies() { fi fi - # 设置npm使用Python3 - npm config set python python3 # 清理旧的node_modules if [[ -d "node_modules" ]]; then @@ -2035,7 +2031,7 @@ update_install_dependencies() { print_info "正在重新安装依赖(可能需要几分钟)..." - if npm install --production; then + if PYTHON=python3 npm install --production; then print_success "依赖更新完成" else print_error "依赖更新失败"