gpt4 book ai didi

node.js - 无法在 Windows 10 中安装 Electron

转载 作者:太空宇宙 更新时间:2023-11-03 22:27:26 25 4
gpt4 key购买 nike

您好,我正在尝试使用以下命令在 Windows 系统中安装 Electron 。

- npm install -g electron
- npm install electron
- npm install electron --save-dev

对于所有这些命令,我​​收到以下错误。

C:\Users\abc\Desktop\final\new>electron@
'electron@' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\abc\Desktop\final\new>npm install electron

> electron@1.6.6 postinstall C:\Users\abc\Desktop\final\new\node_modules\electron
> node install.js

C:\Users\abc\Desktop\final\new\node_modules\electron\install.js:47
throw err
^

Error: ENOENT: no such file or directory, lstat 'C:\Users\abc\Desktop\final\new\node_modules\electron\dist\resources'
npm WARN Alfa@1.0.0 No repository field.
npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "electron"
npm ERR! node v7.9.0
npm ERR! npm v4.2.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1

npm ERR! electron@1.6.6 postinstall: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the electron@1.6.6 postinstall script 'node install.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the electron package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node install.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs electron
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls electron
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\abc\AppData\Roaming\npm-cache\_logs\2017-04-30T12_57_18_073Z-debug.log

C:\Users\abc\Desktop\final\new>

我也尝试更新 Node 和 npm,但仍然收到此错误。有人可以帮帮我吗 ? 。提前致谢。

最佳答案

最近我在 Ubuntu 16.04 上使用 Node.js v8 时遇到了这个问题。但是当我降级到 Node.js v6 时,它安装成功了。

关于node.js - 无法在 Windows 10 中安装 Electron,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43706749/

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