1.打开命令窗口,获取Mac超级权限,然后切换超级权限 sudo su
2.进入Users/mac删除之前的.nvm目录
3.打开nodejs官网Node.js — 下载 Node.js®
# installs nvm (Node Version Manager)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
# download and install Node.js (you may need to restart the terminal)
nvm install 11
# verifies the right Node.js version is in the environment
node -v # should print `v11.15.0`
# verifies the right NPM version is in the environment
npm -v # should print `6.7.0`
配置全局环境变量
vim \~/.bash_profile
vim \~/.zshrc
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
source \~/.bash_profile
source \~/.zshrc
4.修改代理
git config --global --unset http.proxy
git config --global --unset https.proxy
Git 连接问题:fatal: unable to access ‘https://github.com/...../‘: Failed to connect to git-CSDN博客65