Linux(CentOS)安装NVM
Github地址:https://github.com/nvm-sh/nvm. 个人觉得,Github官网上说的不好理解,而国内终端博客主写的也云里雾里,没几个写得清楚写得好的。目前为止,NVM最新版本是0.34.0
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash
或者
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash
任选其一,其中wget方式可能会因mini版CentOS未自带wget包而无法使用
回车后开始安装,安装完成后提示如下信息。
[root@localhost ~]# curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 13226 100 13226 0 0 3752 0 0:00:03 0:00:03 --:--:-- 3752
=> Downloading nvm as script to '/root/.nvm'
=> Appending nvm source string to /root/.bashrc
=> Appending bash_completion source string to /root/.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
大致意思是:
加载nvm资源和bash_completion资源的命令字符串已经写入到/root/.bashrc文件中了,现在关闭然后重启你的命令行工具,然后就可以开始使用你安装的nvm了.
重启命令行工具后(一定要重新启动连接服务器),接下来,我们输入 nvm
测试一下是否成功了,如果弹出一大堆nvm开头的命令提示说明安装成功。
本文由 创作,采用 知识共享署名4.0 国际许可协议进行许可。本站文章除注明转载/出处外,均为本站原创或翻译,转载前请务必署名。最后编辑时间为: 2021/07/03 03:55