ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

Electron 7.1.10 迷之安装失败

2020-01-26 22:55:29  阅读:266  来源: 互联网

标签:node 10 electron manager js Electron 7.1 npm hdi


最近遇到一个问题。那就是macOS插上NTFS格式的移动硬盘无法读写,然后发现有的文件系统提示被macOS占用无法打开,每次要执行命令手动挂载...然后对于懒癌的我是无法接受的,因此萌生了用Electron开发一个小工具,由于之前用的electron-vuw,内置的是Electron 2.x的版本,不支持macOS黑暗模式,准备尝试使用Electron 7.x,发现是各种安装不上了啊!!

> 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

然后就OK了!

标签:node,10,electron,manager,js,Electron,7.1,npm,hdi
来源: https://blog.51cto.com/xvjunjie/2468446

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有