记录 | 安装nvm报错Failed to download ‘https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/nvm.sh‘

node 安装 nvm 报错:

Failed to download ‘https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/nvm.sh’

具体报错:

=> Downloading nvm as script to '/home/codingai/.nvm'
Failed to download 'https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/nvm.sh'
Failed to download 'https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/bash_completion'
Failed to download 'https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/nvm-exec'

=> nvm source string already in /home/codingai/.bashrc
=> bash_completion source string already in /home/codingai/.bashrc
=> Close and reopen your terminal to start using nvm or run the following to use it now:

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion

解决办法:

sudo vim /etc/hosts

# 加入
185.199.108.133 raw.githubusercontent.com

然后就可以咯

记录 | 安装nvm报错Failed to download ‘https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/nvm.sh‘_第1张图片

你可能感兴趣的:(踩坑记录,node,nvm,linux,hosts)