怎么解决Electron7安装失败问题

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

我们提供的服务有:成都网站设计、成都网站制作、微信公众号开发、网站优化、网站认证、托克逊ssl等。为成百上千企事业单位解决了网站和推广的问题。提供周到的售前咨询和贴心的售后服务,是有科学管理、有技术的托克逊网站制作公司

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


文章题目:怎么解决Electron7安装失败问题
标题路径:http://pwwzsj.com/article/jpoeis.html