【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
。
成功
🌟公众号:永燃的瞳术师。喜欢青墟的文章请点赞,关注,分享!您有什么自己的感悟,欢迎在下面留言和大家一起分享🌙