Skip to content

v0.3.4

Choose a tag to compare

@33moren33 33moren33 released this 23 Aug 17:10
· 3 commits to main since this release

修掉 0.3.3 自己带出来的一处倒退,并给卡死的下载装上超时与取消。

0.3.3 发出去四小时后,我们照着它自己的公告,从 npm 装了一个依赖较多的聚合插件包,当场撞上四件事——第一件是那一版新引入的。

  • 换源重试原来对任何失败都触发,第一次真上场就把跑了 23 分钟的安装从头再来。而那次其实是被中断的,npm 一个字都没输出,真正卡住的是某个依赖的安装脚本在连 GitHub——换哪个源都救不了。现在只在 npm 明说 E404ETARGET 时才换源。
  • 下载有了 15 分钟总超时,到点连它起的所有子进程一起结束。真正卡住的往往不是 npm 自己,是它子孙里某个 postinstall 在下二进制。
  • 新增 packages cancel,窗口上也有「停止下载」按钮。此前停一个卡死的安装只能去 shell 里 taskkill
  • 进度不再只是一个计时器:会一并报包树里已经落盘多少个包,安装脚本自己的输出也透出来了。

⚠️ 装第三方插件时,npm 会连带执行它依赖里的安装脚本,其中可能有从境外拉可执行文件的。国内网络下这是最容易卡住的一步——卡了就 packages cancel,或等 15 分钟自动结束。


In English —— fixes a regression 0.3.3 introduced, and gives a stuck download a timeout and a stop button.

The registry retry added in 0.3.3 fired on any npm failure; the first time it ran for real it threw away a 23-minute install to start over, when the actual blocker was a dependency's install script reaching an unreachable host. It now retries only when npm says E404/ETARGET. Downloads get a 15-minute cap that ends the whole process tree, a new packages cancel command with a matching button in the window, and a progress line that reports how many packages have landed rather than only counting seconds.