由于 yarn 超时,升级到 3.3.0-beta6 时出错

我收到此错误:

I, [2024-08-07T11:22:31.056567 #1]  INFO -- : > cd /var/www/discourse && su discourse -c 'yarn install --frozen-lockfile && yarn cache clean'
warning Resolution field "unset-value@2.0.1" is incompatible with requested version "unset-value@^1.0.0"
error Error: https://registry.yarnpkg.com/rxjs/-/rxjs-6.6.7.tgz: ESOCKETTIMEDOUT

<s
当我点击链接时,我看到这个。不知道这是否相关。


</s

最终错误消息:

FAILED
--------------------
Pups::ExecError: cd /var/www/discourse &amp;&amp; su discourse -c 'yarn install --frozen-lockfile &amp;&amp; yarn cache clean' failed with return #&lt;Process::Status: pid 345 exit 1&gt;
Location of failure: /usr/local/lib/ruby/gems/3.3.0/gems/pups-1.2.1/lib/pups/exec_command.rb:132:in `spawn'
exec failed with the params {"cd"=>"$home", "hook"=>"yarn", "cmd"=>["if [ \"$version\" != \"tests-passed\" ]; then\n  rm -rf app/assets/javascripts/node_modules\nfi", "su discourse -c 'yarn install --frozen-lockfile &amp;&amp; yarn cache clean'"]}
bootstrap failed with exit code 1

这个对我来说是有效的:

wget https://registry.yarnpkg.com/rxjs/-/rxjs-6.6.7.tgz

顺便问一下,你是指 3.4.0 吗?

1 个赞

had a colon at the end :roll_eyes:

dashboard tells me 3.3.0-beta6 is latest..

Just found this topic, will try that:

这本身就很奇怪,应该更像:

我也看到了另一个实例:

3 个赞

啊,谢谢,我错过了。

好的,已根据 Stuck on yarn install, Time out 进行修复。

供参考,我在 /var/discourse/templates/web.template.yml 中添加了以下代码块:

  - exec:
      cd: $home
      cmd:
       - su discourse -c 'yarn config set network-timeout 600000 -g'

在此代码块之前:

  - exec:
      cd: $home
      hook: yarn
      cmd:
        - |-
          if [ "$version" != "tests-passed" ]; then
            rm -rf app/assets/javascripts/node_modules
          fi
        - su discourse -c 'yarn install --frozen-lockfile &amp;&amp; yarn cache clean'

但为什么会超时?链接主题中的解决方案指出这是因为服务器配置较低(Google e2.micro 实例,2 核,1 GB RAM)。但这台服务器是 4 核,6GB 的 VPS。

6 个赞

感谢分享解决方案@nolo。这不是人们第一次遇到这个问题了,所以让我们在默认模板中改进一下:

6 个赞

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.