【Homebrew】Mac安装node报错

下面是通过 brew install node 执行,但是报错了。

➜  /tmp brew install node
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/bottles/libuv-1.42.0.monterey.bottle.tar.gz
curl: (22) The requested URL returned error: 404

Warning: Bottle missing, falling back to the default domain...
==> Downloading https://ghcr.io/v2/homebrew/core/libuv/manifests/1.42.0
Already downloaded: /Users/runzhliu/Library/Caches/Homebrew/downloads/4ce1023eed1fe46fcf9d27bb80ca32edb847285d1976eb5663e78eebf13c5982--libuv-1.42.0.bottle_manifest.json
==> Downloading https://ghcr.io/v2/homebrew/core/libuv/blobs/sha256:9065ec0fbc415fa235ed422edb22fd45b28d5a3207ce9e1b0565903f2ce33fd4
Already downloaded: /Users/runzhliu/Library/Caches/Homebrew/downloads/3bf90de0784d8836130616c725afabfcea9c770bd877c65c44dad32a09d9a8ae--libuv--1.42.0.monterey.bottle.tar.gz
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/bottles/openssl%401.1-1.1.1m.monterey.bottle.tar.gz
Already downloaded: /Users/runzhliu/Library/Caches/Homebrew/downloads/aeaeddbc066154a6a2c95c81e016b45e24802199c03562d19cd5ea2f4563651a--openssl@1.1-1.1.1m.monterey.bottle.tar.gz
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/bottles/node-17.3.0.monterey.bottle.tar.gz
curl: (22) The requested URL returned error: 404

Warning: Bottle missing, falling back to the default domain...
==> Downloading https://ghcr.io/v2/homebrew/core/node/manifests/17.3.0
Already downloaded: /Users/runzhliu/Library/Caches/Homebrew/downloads/62db815e59375a25f6a69241c76599c42de672de4feac8071b4131cbc60bc444--node-17.3.0.bottle_manifest.json
==> Downloading https://ghcr.io/v2/homebrew/core/node/blobs/sha256:d2ca921aa8849d4492d5de83bcd47b3db062a17e73b25d9cc4fe6649f59b51cb
Already downloaded: /Users/runzhliu/Library/Caches/Homebrew/downloads/963a04111f17107835e51b203e1a65049873201b2455c19576985353ef6dda37--node--17.3.0.monterey.bottle.tar.gz
==> Installing dependencies for node: libuv and openssl@1.1
==> Installing node dependency: libuv
==> Pouring libuv-1.42.0.monterey.bottle.tar.gz
Error: No such file or directory @ rb_sysopen - /Users/runzhliu/Library/Caches/Homebrew/downloads/e874c93159bf4856f79b7934a9a25556c21423f7241632362bb9a62160b6b476--libuv-1.42.0.monterey.bottle.tar.gz

很多同学这里就会卡住,所以还是要仔细看看报错的日志,这里说 libuv 找不到,那换个思路,先 brew install libuv,发现成功了。

➜  /tmp brew install libuv
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/bottles/libuv-1.42.0.monterey.bottle.tar.gz
curl: (22) The requested URL returned error: 404

Warning: Bottle missing, falling back to the default domain...
==> Downloading https://ghcr.io/v2/homebrew/core/libuv/manifests/1.42.0
Already downloaded: /Users/runzhliu/Library/Caches/Homebrew/downloads/4ce1023eed1fe46fcf9d27bb80ca32edb847285d1976eb5663e78eebf13c5982--libuv-1.42.0.bottle_manifest.json
==> Downloading https://ghcr.io/v2/homebrew/core/libuv/blobs/sha256:9065ec0fbc415fa235ed422edb22fd45b28d5a3207ce9e1b0565903f2ce33fd4
Already downloaded: /Users/runzhliu/Library/Caches/Homebrew/downloads/3bf90de0784d8836130616c725afabfcea9c770bd877c65c44dad32a09d9a8ae--libuv--1.42.0.monterey.bottle.tar.gz
==> Pouring libuv--1.42.0.monterey.bottle.tar.gz

虽然没仔细看过 brew 的代码,但是根据这两处日志,判断我采用的 brew 的源中没有 libuv–1.42.0.monterey.bottle.tar.gz 这个包,但是有 node 的包,而在下载的过程中,一般来说遇到 domain,也就是源不存在的包,可能会降级到默认的 domain,可能是国外的源,但是这里安装 node 的时候已经选定了我设置的源,所以找 libuv 的时候没找到,但是没有直接给降级到默认的 domain,所以这里存在我直接 brew install libuv 成功,但是通过 brew install node 来安装 libuv 失败了。

最后 libuv 安装成功后,重新执行一下 brew install node 问题就解决了。

➜  /tmp brew install node
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/bottles/openssl%401.1-1.1.1m.monterey.bottle.tar.gz
Already downloaded: /Users/runzhliu/Library/Caches/Homebrew/downloads/aeaeddbc066154a6a2c95c81e016b45e24802199c03562d19cd5ea2f4563651a--openssl@1.1-1.1.1m.monterey.bottle.tar.gz
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/bottles/node-17.3.0.monterey.bottle.tar.gz
curl: (22) The requested URL returned error: 404

Warning: Bottle missing, falling back to the default domain...
==> Downloading https://ghcr.io/v2/homebrew/core/node/manifests/17.3.0
Already downloaded: /Users/runzhliu/Library/Caches/Homebrew/downloads/62db815e59375a25f6a69241c76599c42de672de4feac8071b4131cbc60bc444--node-17.3.0.bottle_manifest.json
==> Downloading https://ghcr.io/v2/homebrew/core/node/blobs/sha256:d2ca921aa8849d4492d5de83bcd47b3db062a17e73b25d9cc4fe6649f59b51cb
Already downloaded: /Users/runzhliu/Library/Caches/Homebrew/downloads/963a04111f17107835e51b203e1a65049873201b2455c19576985353ef6dda37--node--17.3.0.monterey.bottle.tar.gz
==> Installing dependencies for node: openssl@1.1
==> Installing node dependency: openssl@1.1
==> Pouring openssl@1.1-1.1.1m.monterey.bottle.tar.gz
🍺  /usr/local/Cellar/openssl@1.1/1.1.1m: 8,081 files, 18.5MB
==> Installing node
==> Pouring node--17.3.0.monterey.bottle.tar.gz
🍺  /usr/local/Cellar/node/17.3.0: 1,976 files, 45.8MB
==> Running `brew cleanup node`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
  • 3
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值