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

1.4 KiB
Raw Blame History

快速开始指南

解决 wails.json 错误

如果遇到 "wails.json: The system cannot find the file specified" 错误,请按以下步骤操作:

步骤 1: 安装前端依赖

cd frontend
npm install

步骤 2: 构建前端

npm run build

这会生成 assets 目录和所有前端资源。

步骤 3: 运行应用

cd ..
go run app.go

如果仍然遇到问题

检查文件是否存在

确保以下文件存在:

  • wails.json ✓ (已创建)
  • assets/ 目录 ✓ (已创建)
  • assets/index.html ✓ (已创建)

如果 assets 目录为空

需要先构建前端:

cd frontend
npm install
npm run build
cd ..

验证 Go 模块

go mod tidy
go mod download

检查 Wails3 版本

确保使用的是正确的 Wails3 版本。如果使用的是 Wails v2配置方式可能不同。

开发模式

前端开发(热重载)

cd frontend
npm run dev

后端开发

在另一个终端:

go run app.go

常见错误解决

1. "module not found"

go mod tidy
go mod download

2. "assets not found"

确保已构建前端:

cd frontend
npm run build

3. "ffmpeg not found"

确保 FFmpeg 已安装并在 PATH 中:

ffmpeg -version