从 Git 而不是 curl 或 wget 安装 nvm 有什么优势?

问题描述

您可以使用

安装 nvm

卷曲:curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash

wget:wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash

或 Git:git clone https://github.com/creationix/nvm.git ~/.nvm

one article 中,用户说“I like to always grab the git one if possible

我想知道的:

  1. 这三种不同方式中的任何一种安装 nvm 有什么区别吗?

  2. 正如文章作者所说,为什么用户更喜欢使用 Git 来做这件事?

解决方法

使用 githubusercontent.com 时,您必须具体说明您尝试下载的版本,这有点麻烦。此外,它并不能保证您提取的是最新的。

虽然克隆 git 本身应该保证你正在拉主分支,在正常的 git 工作流程中,它应该在新版本发布后始终保持最新。