配置并启动 Next.js 前端服务。
cd aigc-claw/frontend
npm install
注意:如果安装慢,可使用国内镜像:
bash npm config set registry https://registry.npmmirror.com npm install
# 复制配置示例文件
cp .env.local.example .env.local
通常无需修改默认配置。
# 首次 build(必须)
npm run build
# 启动服务
npm start
curl http://localhost:3000
返回 HTML 表示成功。
首次初始化后,后续启动只需:
cd aigc-claw/frontend
npm start
| 错误 | 原因 | 解决方法 |
|---|---|---|
npm: command not found |
Node.js 未安装 | 安装 Node.js 18+ |
Error: Could not find or load config file |
.next 目录损坏 | rm -rf .next && npm run build |
| 白屏/空白页面 | build 缓存问题 | rm -rf .next && npm run build |
Address already in use |
端口 3000 被占用 | lsof -ti :3000 | xargs kill |
| 依赖安装失败 | 网络问题 | 使用镜像或科学上网 |