gpt4 book ai didi

rust - 用 Rust 项目构建 Electron 时遇到问题

转载 作者:行者123 更新时间:2023-11-29 08:31:46 26 4
gpt4 key购买 nike

<分区>

我找到了一个github项目,用Rust运行electron,看起来挺简单的。但是,我无法成功构建它。
https://github.com/asaladino/electron-rust

当我尝试使用“npm build”构建时,我失败了。

以下是我得到的:


PS D:_src.git\electron-rust> npm install

ref-napi@1.4.1 install D:_src.git\electron-rust\node_modules\ref-napi
node-gyp rebuild


D:_src.git\electron-rust\node_modules\ref-napi>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\....\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
gyp ERR! configure error
gyp ERR! stack Error: Command failed: C:\ProgramData\Anaconda3\python.EXE -c import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack File "", line 1
gyp ERR! stack import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack ^
gyp ERR! stack SyntaxError: invalid syntax
gyp ERR! stack
gyp ERR! stack at ChildProcess.exithandler (child_process.js:294:12)
gyp ERR! stack at ChildProcess.emit (events.js:189:13)
gyp ERR! stack at maybeClose (internal/child_process.js:970:16)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
gyp ERR! cwd D:_src.git\electron-rust\node_modules\ref-napi
gyp ERR! node -v v10.15.1
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm WARN electron-rust@1.0.0 No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ref-napi@1.4.1 install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ref-napi@1.4.1 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Chaokuo\AppData\Roaming\npm-cache_logs\2019-05-05T14_44_35_607Z-debug.log

我也试过“Electron ”。然后出现了 Electron 应用程序。但是,它可能不会调用 Rust 程序。开发者模式控制台显示找不到模块“ffi-napi”。

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com