温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

怎么解决Electron 7安装失败问题

发布时间:2020-06-03 21:34:30 来源:亿速云 阅读:374 作者:Leah 栏目:web开发

怎么解决Electron 7安装失败问题?相信很多人对此束手无策,这篇文章介绍了Electron 7安装失败的解决方法,希望你能借助这篇文章完美解决这个问题。

> electron@7.1.10 postinstall /Users/key/Source/WebStormProjects/hdi-manager/node_modules/electron
> node install.js

(node:34913) UnhandledPromiseRejectionWarning: HTTPError: Response code 404 (Not Found)
    at EventEmitter.emitter.on.response (/Users/key/Source/WebStormProjects/hdi-manager/node_modules/got/source/as-stream.js:35:24)
    at EventEmitter.emit (events.js:198:13)
    at module.exports (/Users/key/Source/WebStormProjects/hdi-manager/node_modules/got/source/get-response.js:22:10)
    at ClientRequest.handleResponse (/Users/key/Source/WebStormProjects/hdi-manager/node_modules/got/source/request-as-event-emitter.js:155:5)
    at Object.onceWrapper (events.js:286:20)
    at ClientRequest.emit (events.js:203:15)
    at ClientRequest.origin.emit.args [as emit] (/Users/key/Source/WebStormProjects/hdi-manager/node_modules/@szmarczak/http-timer/source/index.js:37:11)
    at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:556:21)
    at HTTPParser.parserOnHeadersComplete (_http_common.js:109:17)
    at TLSSocket.socketOnData (_http_client.js:442:20)
(node:34913) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:34913) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
npm WARN hdi-manager@1.0.0 No repository field.

无奈~只有看看源码为啥不行了!发现:Electron 7.0.0以后的版本下载地址多了个字母v,然后安装下载的时候就会404...

解决方法:

npm install -g cross-env
cross-env npm_config_electron_mirror="https://npm.taobao.org/mirrors/electron/" npm_config_electron_custom_dir="7.1.10" npm install

关于Electron 7安装失败的解决方法就分享到这里了,希望以上内容可以对大家有一定的帮助,可以学到更多知识。如果觉得文章不错,可以把它分享出去让更多的人看到。

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI