怎么解決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.
無奈~只有看看源碼為啥不行了!發(fā)現(xiàn):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
關(guān)于Electron 7安裝失敗的解決方法就分享到這里了,希望以上內(nèi)容可以對大家有一定的幫助,可以學(xué)到更多知識。如果覺得文章不錯,可以把它分享出去讓更多的人看到。
另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)cdcxhl.cn,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務(wù)可用性高、性價比高”等特點(diǎn)與優(yōu)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場景需求。