Warning: formula.jws.json: update failed, falling back to cached version.

Warning: formula.jws.json: update failed, falling back to cached version.

MacOS 执行服务启动命令时,显示下载失败警告,导致无法启动服务

MacBook-Pro ~ % brew services start nginx
==> Downloading https://formulae.brew.sh/api/formula.jws.json
########                                                                                                                                                                                              4.5%curl: (28) Operation too slow. Less than 100 bytes/sec transferred the last 5 seconds

Warning: formula.jws.json: update failed, falling back to cached version.
==> Downloading https://formulae.brew.sh/api/formula.jws.json
##                                                                                                                                                                                                    1.4%curl: (28) Operation too slow. Less than 100 bytes/sec transferred the last 5 seconds

Warning: formula.jws.json: update failed, falling back to cached version.
==> Downloading https://formulae.brew.sh/api/formula.jws.json
#############                                                                                                                                                                                         6.7%curl: (28) Operation too slow. Less than 100 bytes/sec transferred the last 5 seconds

Warning: formula.jws.json: update failed, falling back to cached version.
==> Downloading https://formulae.brew.sh/api/formula.jws.json
curl: (28) Operation too slow. Less than 100 bytes/sec transferred the last 5 seconds                                                                                                   #      #    #  #

Error: Failure while executing; `/usr/bin/env /usr/local/Homebrew/Library/Homebrew/shims/shared/curl --disable --cookie /dev/null --globoff --user-agent Homebrew/4.1.21\ \(Macintosh\;\ Intel\ Mac\ OS\ X\ 14.5\)\ curl/8.6.0 --header Accept-Language:\ en --fail --progress-bar --remote-time --output /Users/advoster/Library/Caches/Homebrew/api/formula.jws.json --location --disable --cookie /dev/null --globoff --show-error --user-agent Homebrew/4.1.21\ \(Macintosh\;\ Intel\ Mac\ OS\ X\ 14.5\)\ curl/8.6.0 --header Accept-Language:\ en --fail --progress-bar --compressed --speed-limit 100 --speed-time 5 https://formulae.brew.sh/api/formula.jws.json` exited with 28. Here's the output:
curl: (28) Operation too slow. Less than 100 bytes/sec transferred the last 5 seconds

解决方案

修改 HOMEBREW_API_DOMAIN

export HOMEBREW_API_DOMAIN="https://mirrors.ustc.edu.cn/homebrew-bottles/api"
# 或
export HOMEBREW_API_DOMAIN="https://mirrors.aliyun.com/homebrew/homebrew-bottles/api"

如该命令只在终端窗口执行,那么这个命令只会对当前终端窗口有效,想要永久保存这个参数的话,请将该命令添加到名为 .zshrc 的配置文件中去。

想要新的配置立即生效,执行如下命令:

source ~/.zshrc
  • 重新执行服务启动命令结果:

    MacBook-Pro ~ % brew services start nginx
    ==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/api/formula.jws.json
    ################################################################################################################################################################################################### 100.0%
    Service `nginx` already started, use `brew services restart nginx` to restart.
    
  • 2
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值