5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-02 06:19:43 +08:00
wails/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/gettingstarted/installation.mdx
2021-09-27 19:35:30 +10:00

72 lines
1.9 KiB
Plaintext
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.

---
title: 安装
sidebar_position: 1
---
# 安装
## 支持的平台
- Windows 10
- MacOS x64 & arm64 (due October '21)
- Linux (due December '21)
## 依赖
Wails 有许多安装前需要的常见依赖项:
- Go 1.16+
- npm LTS
### Go
从 [Go 下载页面](https://golang.org/dl/) 下载 Go。
确保你遵守官方的 [Go 安装说明](https://golang.org/doc/install#install)。你还需要确保你的 `PATH` 环境变量包含你的 `~/go/bin` 目录路径。 重启终端并执行以下命令检查:
- 检查 Go 是否安装正确: `go version`
- 检查 "~/go/bin" 是否在你的 PATH 变量中: `echo $PATH | grep go/bin`
### npm
从 [Node 下载页面](https://nodejs.org/en/download/) 下载 Npm。最好使用最新版本因为这是我们通常会测试的版本。
运行 `npm --version` 进行校验。
## 平台指定依赖关系
你还需要安装指定平台的依赖项:
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
<Tabs
defaultValue="Windows"
values={[
{ label: "Windows", value: "Windows" },
{ label: "MacOS", value: "MacOS" },
{ label: "Linux", value: "Linux" },
]}
>
<TabItem value="Windows">
Wails 要求安装
<a href="https://developer.microsoft.com/zh-cn/microsoft-edge/webview2/">WebView2</a>
运行时。一些 Windows 已经默认安装了这个。你可以使用 <code>wails doctor</code>
命令进行检查(见下文)。
</TabItem>
<TabItem value="MacOS">即将推出...</TabItem>
<TabItem value="Linux">即将推出...</TabItem>
</Tabs>
## 可选依赖
- [UPX](https://upx.github.io/) 用于压缩你的应用程序。
## 安装 Wails
运行 `go get github.com/wailsapp/wails/v2/cmd/wails` 安装 Wails CLI。
## 系统检查
运行 `wails doctor` 将检查你是否安装了正确的依赖项。如果没有,它会就缺少的内容提供建议并帮助纠正任何问题。