Files
Nexus/docs/changelog/2026-05-22-mysql-mcp-node20-fix.md
2026-07-08 22:31:31 +08:00

36 lines
898 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Changelog — 修复 mysql-mcp Node 18 SyntaxError
**日期**: 2026-05-22
**类型**: Bugfix / MCP
## 问题
```
SyntaxError: Unexpected token 'with'
import packageJson from '../package.json' with { type: 'json' };
```
WSL 默认 Node **v18.19.1**,不满足 `@yclenove/mysql-mcp-server` 对 Node **≥20** 的要求。
## 修复
1. 新增 `scripts/wsl_mcp_mysql.sh` — 优先 WSL Node 20,回退 Windows `C:\nvm4w\nodejs\node.exe` v22
2. 更新 `.cursor/mcp.json` 调用该脚本
3. 新增 `scripts/wsl_install_node20.sh` — 用户级安装 Node v20.19.2 到 `~/.local/`
## 用户操作
```bash
# WSL 内(推荐,可同时连 172.31.x MySQL
bash scripts/wsl_install_node20.sh
```
然后 **Cursor → Reload Window** 重新连接 MCP。
## 涉及文件
- `.cursor/mcp.json`
- `scripts/wsl_mcp_mysql.sh`
- `scripts/wsl_install_node20.sh`
- `docs/project/mysql-mcp-setup.md`