【nodejs打包軟件PKG】pkg報錯Error! ESOCKETTIMEDOUT 和 Asset not found by direct link


C:\Users\Administrator\Desktop\vivo X6S A 20200407210303.vbak>pkg savebianqian.js  
> pkg@4.4.6
> Targets not specified. Assuming:
  node12-linux-x64, node12-macos-x64, node12-win-x64
> Fetching base Node.js binaries to PKG_CACHE_PATH
  fetched-v12.16.1-linux-x64   [                    ] 0%
> Error! read ECONNRESET
> Asset not found by direct link:
  {"tag":"v2.6","name":"uploaded-v2.6-node-v12.16.1-linux-x64"}
  fetched-v12.16.1-linux-x64   [                    ] 0%
> Error! ESOCKETTIMEDOUT
C:\Users\Administrator\Desktop\vivo X6S A 20200407210303.vbak>pkg -t win savebianqian.js  
> pkg@4.4.6
> Fetching base Node.js binaries to PKG_CACHE_PATH
  fetched-v12.16.1-win-x64     [                    ] 0%
> Error! ESOCKETTIMEDOUT
> Asset not found by direct link:
  {"tag":"v2.6","name":"uploaded-v2.6-node-v12.16.1-win-x64"}
  fetched-v12.16.1-win-x64     [                    ] 0%
> Error! ESOCKETTIMEDOUT

pkg打包一個JavaScript文件時出現錯誤,正在排查


https://www.jianshu.com/p/e0e6d42cb978

看了別人的文章,我得自己爬梯子去找文件了,終於,谷歌瀏覽器ctrl+F搜索了一下“uploaded-v2.6-node-v12.16.1-win-x64”找到了,開始下載

此處版本號就是對應要下載的,我這里是2.6,所以上github找2.6版本的release。

根據錯誤提示我需要下載fetched-v12.16.1-win-x64,下載完“uploaded-v2.6-node-v12.16.1-win-x64”后放在C:\Users\Administrator\.pkg-cache\v2.6上面那個用戶目錄下,並把名字改為fetched-v12.16.1-win-x64。

然后我去我的文件夾C:\Users\Administrator\.pkg-cache\v2.6里看,發現兩個downloading,下載卡死在半中間的文件

我想就是他們兩個了,於是把已經下載好的fetched-v12.16.1-win-x64(原名為uploaded-v2.6-node-v12.16.1-win-x64)

然后那兩個沒用的downloading就可以刪掉了。

然后繼續打包我的js文件pkg -t win savebianqian.js

成功


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM