无法在Windows 10中安装电子

时间:2017-04-30 13:09:36

标签: node.js electron

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

- 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>

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

1 个答案:

答案 0 :(得分:0)

最近我在Ubuntu 16.04上遇到Node.js v8的这个问题。但是当我降级到Node.js v6然后它成功安装。