无法在Windows 10中安装电子 [英] could not install electron in windows 10

查看:77
本文介绍了无法在Windows 10中安装电子的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

Hi I am trying to install electron in my windows system using this following commands.

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

所有这些命令我都收到以下错误。

For all these command I am getting the following error.

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,但仍然出现此错误。有人可以帮帮我吗 ? 。

I also tried updating node and npm but still I am getting this error. Can someone please help me ? . Thanks in advance.

推荐答案

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

Recently I had this problem with Node.js v8 on Ubuntu 16.04. But when I downgraded to Node.js v6 then it installed successfully.

这篇关于无法在Windows 10中安装电子的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆