前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >【Homebrew】Mac安装node报错

【Homebrew】Mac安装node报错

作者头像
runzhliu
发布2022-04-13 13:54:30
1.1K0
发布2022-04-13 13:54:30
举报
文章被收录于专栏:容器计算

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

代码语言:javascript
复制
➜  /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,发现成功了。

代码语言:javascript
复制
➜  /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 问题就解决了。

代码语言:javascript
复制
➜  /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`).
本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2022/02/28 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档