【问题标题】:What is the usage of the git repository question when running npm init?运行 npm init 时 git 仓库问题有什么用?
【发布时间】:2019-12-05 16:25:37
【问题描述】:

在运行npm init 时,系统会要求您提供 git 存储库(我假设是您的项目)。

我想知道为什么? 将项目的 git 存储库 url(package.json 已经在其中)也包含在 package.json 中的用例是什么?

一定是有原因的吧?

【问题讨论】:

    标签: npm npm-init


    【解决方案1】:

    当您将包发布到 NPM 存储库时,包页面内有一个指向 git 存储库的链接。

    【讨论】:

    • 所以这是唯一的原因?那么是不是大多数使用 npm 的项目都没有发布到 NPM 存储库?
    • Specify the place where your code lives. This is helpful for people who want to contribute. If the git repo is on GitHub, then the npm docs command will be able to find you. - 正如文档所说 - 这不是必填字段,因此请随时将其留空或设置假网址(切勿尝试,但应该可以)。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-08-26
    • 2021-08-26
    • 1970-01-01
    • 2016-06-29
    • 2018-12-06
    • 2017-11-06
    • 1970-01-01
    相关资源
    最近更新 更多