NVM-Linux安装

1.一开始各种乱七八糟网上搜索方法安装都无法成功,主要网络问题,第二采用安装包下载安装不知道啥问题也安装不成功,然后添加了环境变量导致一直报错【You have $NVM_DIR set to "/home/wei/.nvm/nvm-0.39.1", but that directory does not exist. Check your profile files and environment.】,这个应该是系统缓存问题---(然后运行下面的重置一下)

unset NVM_DIR

2.采用了网上其他方法(如果没有clone下来多试几次)后来换成gitee秒下

- 注:具体安装路径根据自己喜好需求来,我是>>> cd /usr/local

git clone https://gitee.com/mirrors/nvm

然后cd  usr/local/nvm中   ,然后运行下面的脚本

bash install.sh

需要多试几次才行,服务器国外的问题会中断或链接不上,最后出现变量配置,然后source一下即可

source ~/.bashrc

3.具体下面我运行的状态:

(base) wei@ubuntu:/usr/local/nvm$ bash install.sh 
=> Downloading nvm from git to '/home/wei/.nvm'
=> 正克隆到 '/home/wei/.nvm'...
fatal: 无法访问 'https://github.com/nvm-sh/nvm.git/':GnuTLS recv error (-54): Error in the pull function.
Failed to clone nvm repo. Please report this!
(base) wei@ubuntu:/usr/local/nvm$ bash install.sh 
=> Downloading nvm from git to '/home/wei/.nvm'
=> 正克隆到 '/home/wei/.nvm'...
remote: Enumerating objects: 360, done.
remote: Counting objects: 100% (360/360), done.
remote: Compressing objects: 100% (306/306), done.
remote: Total 360 (delta 40), reused 170 (delta 28), pack-reused 0
接收对象中: 100% (360/360), 219.83 KiB | 1.22 MiB/s, 完成.
处理 delta 中: 100% (40/40), 完成.
fatal: 无法访问 'https://github.com/nvm-sh/nvm.git/':Failed to connect to github.com port 443: 拒绝连接
Failed to fetch origin with v0.39.3. Please report this!
(base) wei@ubuntu:/usr/local/nvm$ bash install.sh 
=> nvm is already installed in /home/wei/.nvm, trying to update using git
=> fatal: 无法访问 'https://github.com/nvm-sh/nvm.git/':Failed to connect to github.com port 443: 拒绝连接
Failed to update nvm with v0.39.3, run 'git fetch' in /home/wei/.nvm yourself.
(base) wei@ubuntu:/usr/local/nvm$ cd /home/
(base) wei@ubuntu:/home$ cd wei/
(base) wei@ubuntu:~$ cd .nvm/
(base) wei@ubuntu:~/.nvm$ git fetch
fatal: 无法访问 'https://github.com/nvm-sh/nvm.git/':Failed to connect to github.com port 443: 拒绝连接
(base) wei@ubuntu:~/.nvm$ git fetch
fatal: 无法访问 'https://github.com/nvm-sh/nvm.git/':Failed to connect to github.com port 443: 拒绝连接
(base) wei@ubuntu:~/.nvm$ git fetch
(base) wei@ubuntu:~/.nvm$ git fetch
(base) wei@ubuntu:~/.nvm$ bash install.sh 
=> nvm is already installed in /home/wei/.nvm, trying to update using git
=> * (头指针分离于 FETCH_HEAD)
  master
=> Compressing and cleaning up git repository

=> Appending nvm source string to /home/wei/.bashrc
=> Appending bash_completion source string to /home/wei/.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
(base) wei@ubuntu:~/.nvm$ nvm

Command 'nvm' not found, but there are 13 similar ones.

(base) wei@ubuntu:~/.nvm$ nvm -v

Command 'nvm' not found, but there are 13 similar ones.

(base) wei@ubuntu:~/.nvm$ source ~/.bashrc
(base) wei@ubuntu:~/.nvm$ nvm -v
0.39.3

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

文虾

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值