从缓存目录位置更改Electron安装

kuarbcqp  于 2023-08-01  发布在  Electron
关注(0)|答案(1)|浏览(356)

由于某些原因,我被限制无法访问Github。

npm WARN deprecated @types/testing-library__react@10.2.0: This is a stub types definition. testing-library__react provides its own type definitions, so you do not need this installed.
npm WARN deprecated @vitejs/plugin-react-refresh@1.3.6: This package has been deprecated in favor of @vitejs/plugin-react
npm WARN deprecated asar@3.2.0: Please use @electron/asar moving forward.  There is no API change, just a package name change
npm WARN deprecated electron-osx-sign@0.6.0: Please use @electron/osx-sign moving forward. Be aware the API is slightly different
npm ERR! code 1
npm ERR! path D:\bcommsui\node_modules\electron
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node install.js
npm ERR! RequestError: connect ECONNREFUSED 140.82.121.4:443
npm ERR!     at ClientRequest.<anonymous> (D:\bcommsui\node_modules\got\dist\source\core\index.js:970:111)
npm ERR!     at Object.onceWrapper (node:events:640:26)
npm ERR!     at ClientRequest.emit (node:events:532:35)
npm ERR!     at ClientRequest.origin.emit (D:\bcommsui\node_modules\@szmarczak\http-timer\dist\source\index.js:43:20)
npm ERR!     at TLSSocket.socketErrorListener (node:_http_client:442:9)
npm ERR!     at TLSSocket.emit (node:events:520:28)
npm ERR!     at emitErrorNT (node:internal/streams/destroy:157:8)
npm ERR!     at emitErrorCloseNT (node:internal/streams/destroy:122:3)
npm ERR!     at processTicksAndRejections (node:internal/process/task_queues:83:21)
npm ERR!     at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1157:16)

字符串
所以我尝试使用本地缓存目录安装Electron-例如。已将副本从C:\Users\my_user_name\AppData\Local\electron\Cache移动到位于以下位置的另一台脱机PC:c:\temp-electron-cache。我还尝试将其移动到离线PC上用户的应用程序数据缓存中,也是在登录用户的名称下,但当我运行'npm install electron'时没有任何区别。
我尝试在离线PC上更改环境变量:

set electron_config_cache="C:\Users\my_user_name\AppData\Local\electron\cache"


在那里我有最新版本的[checksum]/[filename]。
当调用install.js时,如何让npm install electron从另一个位置安装?

of1yzvn4

of1yzvn41#

我在Powershell中实现了这个功能。这就是我所做的:
1.确保校验和目录和zip文件是正确的需要。
1.在Powershell中而不是CMD提示符(注意单引号):
第一个月
这在命令提示符下对我不起作用:set electron_config_cache='C:\Users\my_user_name\AppData\Local\electron\cache'

相关问题