electron-vite_15打包报错proxyconnect

195 阅读1分钟

electron打包报错了,尝试了多个方案没有解决,种种在git上找到了解决方案,记录一下,说不定大家也会遇到;

git相关问题

打包报错:

Get "npmmirror.com/mirrors/ele…": proxyconnect tcp:dial tcp:0:connectex:The requested address is not valid in its context.

在这里插入图片描述

gitHub用户提供解决方案

亲测可用

npm config delete proxy
npm config delete https-proxy
npm config delete noproxy
手动下载这个包,放到以下路径

没有试过

Linux: $XDG_CACHE_HOME or ~/.cache/electron/
macOS: ~/Library/Caches/electron/
Windows: $LOCALAPPDATA/electron/Cache or ~/AppData/Local/electron/Cache/