构建步骤(Windows)
- Windows 10 / Server 2012 R2 或更高版本
-
- 与下面 的安装说明不同,你必须安装 2.7.10 以上版本的 Python(支持 TLS 1.2)。 为此,应确保 PATH 中 Python 的安装目录在
depot_tools
之前。 目前depot_tools
仍捆绑 Python 2.7.6,这将导致gclient
命令失效(见 - Python for Windows (pywin32) 扩展对于构建流程也是必需的。
- 与下面 的安装说明不同,你必须安装 2.7.10 以上版本的 Python(支持 TLS 1.2)。 为此,应确保 PATH 中 Python 的安装目录在
- Git
如果您计划使用Windows SDK 10.0.15063.468的Windows调试工具 创建一个完整的发行版
symstore.exe
用来创建符号 保存于.pdb
文件。- The SDK Debugging Tools must also be installed. If the Windows 10 SDK was installed via the Visual Studio installer, then they can be installed by going to:
Control Panel
→Programs
→Programs and Features
→ Select the "Windows Software Development Kit" →Change
→ → Check "Debugging Tools For Windows" →Change
. Or, you can download the standalone SDK installer and use it to install the Debugging Tools.
如果您当前没有安装 Windows, 上有时间限制的 Windows 版本,你可以用来构建 Electron。
- The SDK Debugging Tools must also be installed. If the Windows 10 SDK was installed via the Visual Studio installer, then they can be installed by going to:
构建 Electron 完全由命令行脚本完成,无法通过 Visual Studio 完成。 您可以使用任何编辑器开发 Electron,但将来将会使用 Visual Studio 构建支持。
注意: 即使 Visual Studio 不用于构建,但是仍然需要,因为我们需要它提供的构建工具链。
To build for the 32bit target, you need to pass target_cpu = "x86"
as a GN arg. You can build the 32bit target alongside the 64bit target by using a different output directory for GN, e.g. out/Release-x86
, with different arguments.
其他构建步骤完全一样。
To generate a Visual Studio project, you can pass the —ide=vs2017
parameter to gn gen
:
如果你遇到了一个错误,类似 , 可以尝试使用 VS2015 Command Prompt
控制台来执行构建脚本.
Fatal internal compiler error: C1001
重新安装 32位的 Node.js.
Error: ENOENT, stat 'C:\Users\USERNAME\AppData\Roaming\npm'
创建那个目录 应该可以解决问题:
如果你使用 Git Bash 来构建,或许会遇到这个错误,可以使用 PowerShell 或 VS2015 Command Prompt 来代替.
cannot create directory at '…': Filename too long
node.js has some extremely long pathnames, and by default git on windows doesn't handle long pathnames correctly (even though windows supports them). This should fix it: