gpt4 book ai didi

javascript - 使用 USB 绑定(bind)配置的 Electron 问题?

转载 作者:行者123 更新时间:2023-12-03 23:55:43 24 4
gpt4 key购买 nike

我在我的 Electron 应用程序中安装 USB 模块时遇到问题。当我尝试安装 Electron 及其依赖项时,我总是遇到以下问题。请有人帮助我实现这一目标。

如果有人做同样的事情,请提供任何链接或说明文件,这将帮助我继续前进。

> master-electron@1.0.0 install C:\Users\\AppData\Roaming\npm\node_modules\master-electron
> prebuild-install || node-gyp rebuild


C:\Users\\AppData\Roaming\npm\node_modules\master-electron>if not defined npm_config_node_gyp (node "C:\Users\\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "C:\Users\ranganathan.e\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
gyp ERR! find Python
gyp ERR! find Python Python is not set from command line or npm configuration
gyp ERR! find Python Python is not set from environment variable PYTHON

gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\AppData\Roaming\npm\node_modules\master-electron
gyp ERR! node -v v12.14.1
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! master-electron@1.0.0 install: `prebuild-install || node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the master-electron@1.0.0 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\AppData\Roaming\npm-cache\_logs\2020-02-26T13_40_04_660Z-debug.log

最佳答案

根据您提供的日志,它说构建脚本找不到 Python。 Electron 使用 node-gyp 构建自身,需要安装 python 和 Visual Studio Build Tools。

我建议您在 npm 上安装 windows-build-tools .它可以使用命令 npm install --global windows-build-tools 安装。

关于javascript - 使用 USB 绑定(bind)配置的 Electron 问题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60415658/

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