mac 安装nvm报错curl: (35) LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to raw.githubusercontent
mac 安装nvm报错curl: (35) LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to raw.githubusercontent.com:443根据网上教程–命令行安装:curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh |
·
mac 安装nvm报错curl: (35) LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to raw.githubusercontent.com:443
根据网上教程–命令行安装:
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash
安装报错,提示:
curl: (35) LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to raw.githubusercontent.com:443
在网上继续搜索,发现,大家很多安装homebrew也类似报错,好像是mac不能通过外部链接来安装,也有的说是dns污染,需要配置host,于是乎,从网上学习得到,配置如下:
199.232.68.133 raw.githubusercontent.com
报错如下:
curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused
反正不管咋样 还是不行
解决方式如下:
使用gitee镜像安装
1.安装nvm
git clone https://gitee.com/mirrors/nvm.git ~/.nvm && cd ~/.nvm && git checkout `git describe --abbrev=0 --tags`
安装提示如下:
hetingting@hetingtingdeMacBook-Pro ~ % git clone https://gitee.com/mirrors/nvm.git ~/.nvm && cd ~/.nvm && git checkout `git describe --abbrev=0 --tags`
Cloning into '/Users/hetingting/.nvm'...
remote: Enumerating objects: 8192, done.
remote: Counting objects: 100% (8192/8192), done.
remote: Compressing objects: 100% (4101/4101), done.
remote: Total 8192 (delta 5263), reused 6340 (delta 4015), pack-reused 0
Receiving objects: 100% (8192/8192), 2.39 MiB | 458.00 KiB/s, done.
Resolving deltas: 100% (5263/5263), done.
Note: switching to 'v0.37.2'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:
git switch -c <new-branch-name>
Or undo this operation with:
git switch -
Turn off this advice by setting config variable advice.detachedHead to false
HEAD is now at 4b947ec v0.37.2
nvm终于安装成功!
2.配置nvm环境变量
(1)进入.bash_profile文件设置环境变量:
vi ~/.bash_profile
(2)配置环境变量:
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
保存文件后退出该文件
TIPS:不会shell命令:
a.打开文件后,输入i,表示进入编辑状态
b.输入变量后,点击esc,表示退出
c.输入:wq,表示保存并退出
(3)执行命令行生效:
source ~/.bash_profile
如果shell使用的是非zsh,以上三步配置完即可,如果是zsh环境,需要多配置以下
如何查看shell:
echo $SHELL
(4)zsh配置:
打开.zshrc文件,输入如下:
打开.zshrc文件:
vim ~/.zshrc
配置如下:
source ~/.bash_profile
保存后退出执行如下命令行使之生效:
source ~/.zshrc
经过如上步骤配置,nvm也配置成功了:
可查看nvm版本:
nvm -v
一把老泪纵横,终于安装好了nvm。
更多推荐
已为社区贡献1条内容
所有评论(0)