VideoConcat/wails3-app/快速开始.md
2026-01-06 19:35:21 +08:00

101 lines
1.4 KiB
Markdown
Raw 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.

# 快速开始指南
## 解决 wails.json 错误
如果遇到 "wails.json: The system cannot find the file specified" 错误,请按以下步骤操作:
### 步骤 1: 安装前端依赖
```powershell
cd frontend
npm install
```
### 步骤 2: 构建前端
```powershell
npm run build
```
这会生成 `assets` 目录和所有前端资源。
### 步骤 3: 运行应用
```powershell
cd ..
go run app.go
```
## 如果仍然遇到问题
### 检查文件是否存在
确保以下文件存在:
- `wails.json` ✓ (已创建)
- `assets/` 目录 ✓ (已创建)
- `assets/index.html` ✓ (已创建)
### 如果 assets 目录为空
需要先构建前端:
```powershell
cd frontend
npm install
npm run build
cd ..
```
### 验证 Go 模块
```powershell
go mod tidy
go mod download
```
### 检查 Wails3 版本
确保使用的是正确的 Wails3 版本。如果使用的是 Wails v2配置方式可能不同。
## 开发模式
### 前端开发(热重载)
```powershell
cd frontend
npm run dev
```
### 后端开发
在另一个终端:
```powershell
go run app.go
```
## 常见错误解决
### 1. "module not found"
```powershell
go mod tidy
go mod download
```
### 2. "assets not found"
确保已构建前端:
```powershell
cd frontend
npm run build
```
### 3. "ffmpeg not found"
确保 FFmpeg 已安装并在 PATH 中:
```powershell
ffmpeg -version
```