最近在我的Mac电脑重新安装node,准备使用nvm来管理。
然后根据官方的说明输入下面的命令来进行下载脚本安装:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
结果直接报错了,显示是无法连接raw.githubusercontent.com。

其实这个问题很简单,我们首先查询一下raw.githubusercontent.com这个地址的IP,然后进行修改host,添加IP和域名进去即可。
例如我查询到的IP为199.232.28.133,先输入以下命令修改host:
sudo vi /etc/hosts
然后添加以下内容:
199.232.28.133 raw.githubusercontent.com
然后就可以正常下载和安装了:

文章评论