mirror of
https://github.com/Wei-Shaw/claude-relay-service.git
synced 2026-01-22 08:32:17 +00:00
- Replace .eslintrc.js with .eslintrc.cjs for better ES module compatibility - Add .prettierrc configuration for consistent code formatting - Update package.json with new lint and format scripts - Add nodemon.json for development hot reloading configuration - Standardize code formatting across all JavaScript and Vue files - Update web admin SPA with improved linting rules and formatting - Add prettier configuration to web admin SPA 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
30 lines
861 B
JavaScript
30 lines
861 B
JavaScript
#!/usr/bin/env node
|
|
|
|
/**
|
|
* 修复 inquirer ESM 问题
|
|
* 降级到支持 CommonJS 的版本
|
|
*/
|
|
|
|
const { execSync } = require('child_process')
|
|
|
|
console.log('🔧 修复 inquirer ESM 兼容性问题...\n')
|
|
|
|
try {
|
|
// 卸载当前版本
|
|
console.log('📦 卸载当前 inquirer 版本...')
|
|
execSync('npm uninstall inquirer', { stdio: 'inherit' })
|
|
|
|
// 安装兼容 CommonJS 的版本 (8.x 是最后支持 CommonJS 的主要版本)
|
|
console.log('\n📦 安装兼容版本 inquirer@8.2.6...')
|
|
execSync('npm install inquirer@8.2.6', { stdio: 'inherit' })
|
|
|
|
console.log('\n✅ 修复完成!')
|
|
console.log('\n现在可以正常使用 CLI 工具了:')
|
|
console.log(' npm run cli admin')
|
|
console.log(' npm run cli keys')
|
|
console.log(' npm run cli status')
|
|
} catch (error) {
|
|
console.error('❌ 修复失败:', error.message)
|
|
process.exit(1)
|
|
}
|