【问题标题】:What is the advantage to installing nvm from Git instead of curl or wget?从 Git 安装 nvm 而不是 curl 或 wget 有什么优势?
【发布时间】:2021-04-17 00:03:16
【问题描述】:

你可以安装 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?

【问题讨论】:

    标签: node.js curl npm wget nvm


    【解决方案1】:

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

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

    【讨论】:

    • 我不确定你对 githubusercontent.com 的意思。你的意思是wgete和curl方式,你必须指定nvm的版本,而git方式,它会自动获取最新版本?
    • curlwget 只是发出 http 请求的 shell 命令。在这种情况下,http 地址是https://raw.githubusercontent.com/,它提供来自 git 存储库的原始文件。默认情况下,git clone 命令会从 master 分支下载源码,正常情况下应该是最新版本。
    • 我在这里谈论的是一般的 git 项目。大多数情况下,大玩家的项目依赖 CI/CD(自动构建系统)。但并非所有项目都在使用它们。因此,不能保证最新版本会自动合并到主分支中。在这种情况下,上述陈述不适用。
    • 完美回答了我的问题,谢谢。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-11-06
    • 2023-04-10
    • 2013-11-25
    • 1970-01-01
    • 2011-09-23
    • 2019-06-03
    • 1970-01-01
    相关资源
    最近更新 更多