【发布时间】:2019-12-05 16:25:37
【问题描述】:
在运行npm init 时,系统会要求您提供 git 存储库(我假设是您的项目)。
我想知道为什么? 将项目的 git 存储库 url(package.json 已经在其中)也包含在 package.json 中的用例是什么?
一定是有原因的吧?
【问题讨论】:
在运行npm init 时,系统会要求您提供 git 存储库(我假设是您的项目)。
我想知道为什么? 将项目的 git 存储库 url(package.json 已经在其中)也包含在 package.json 中的用例是什么?
一定是有原因的吧?
【问题讨论】:
当您将包发布到 NPM 存储库时,包页面内有一个指向 git 存储库的链接。
【讨论】:
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. - 正如文档所说 - 这不是必填字段,因此请随时将其留空或设置假网址(切勿尝试,但应该可以)。