加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

安装electron提示install.js error的问题

发布时间:2020-12-16 08:32:32 所属栏目:百科 来源:网络整理
导读:想尝试下electron开发桌面应用,于是按照官网的流程试了下,发现了个问题。 一、问题 在使用npm install 命令的时候,发现了个error,导致后面demo起不来,报错内容如下: PSD:githubelectron-quick-startnpminstallelectron@2.0.0postinstallD:githubel

想尝试下electron开发桌面应用,于是按照官网的流程试了下,发现了个问题。

一、问题

在使用npm install 命令的时候,发现了个error,导致后面demo起不来,报错内容如下:

PS D:githubelectron-quick-start> npm install

> electron@2.0.0 postinstall D:githubelectron-quick-startnode_moduleselectron
> node install.js

Downloading SHASUMS256.txt
Error: socket hang up
D:githubelectron-quick-startnode_moduleselectroninstall.js:47
 throw err
 ^

Error: socket hang up
 at createHangUpError (_http_client.js:331:15)
 at TLSSocket.socketOnEnd (_http_client.js:423:23)
 at emitNone (events.js:111:20)
 at TLSSocket.emit (events.js:208:7)
 at endReadableNT (_stream_readable.js:1056:12)
 at _combinedTickCallback (internal/process/next_tick.js:138:11)
 at process._tickCallback (internal/process/next_tick.js:180:9)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! electron@2.0.0 postinstall: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the electron@2.0.0 postinstall 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:UsersAdministratorAppDataRoamingnpm-cache_logs2018-07-21T08_04_44_902Z-debug.log

处理方法:

更换淘宝的镜像

npm install cnpm -g --registry=http://registry.npm.taobao.org

使用cnpm install更新后没有问题。

不管为啥了,先记下,快去玩electron咯。


(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读