好的,已根据 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 && yarn cache clean'
但为什么会超时?链接主题中的解决方案指出这是因为服务器配置较低(Google e2.micro 实例,2 核,1 GB RAM)。但这台服务器是 4 核,6GB 的 VPS。