简体   繁体   English

在以下位置找不到 gn 可执行文件:C:\...\buildtools\win\gn.exe

[英]Could not find gn executable at: C:\...\buildtools\win\gn.exe

I'm running into the following error:我遇到以下错误:

Could not find gn executable at: C:\...\JavaScriptApplications\electron\buildtools\win\gn.exe

after running the following gclient command as part of the instructions to build electron from source :在运行以下gclient命令作为从源代码构建 electron的说明的一部分后:

gn gen out/Release --args="import(\"//electron/build/args/release.gn\")"

Note: I've already found some possible solutions that I would like to share in order to help anyone else running into this error.注意:我已经找到了一些可能的解决方案,我想分享这些解决方案,以帮助其他遇到此错误的人。

Initially, I ended up resolving the issue by manually creating the folder structure buildtools\win\ at the specified path and then moving the gn.exe file I downloaded from the gn website into it.最初,我通过在指定路径手动创建文件夹结构buildtools\win\然后将我从gn 网站下载的gn.exe文件移动到其中来解决问题。

Later I realized the issue could be due to me running that gclient command in a Git Bash terminal in VSCode instead of the intended Command Prompt.后来我意识到问题可能是由于我在 VSCode 中的 Git Bash 终端中运行gclient命令而不是预期的命令提示符。

Indeed, running the gclient commands via Command Prompt as Administrator worked as expected.实际上,以管理员身份通过命令提示符运行gclient命令可以正常工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM