node.js - 如何在 package.json 文件中添加 git repo

标签 node.js git github npm package.json

我有一个应用程序,我在执行 npm init 时没有在 package.json 中添加它的存储库。

现在我想在 package.json 文件中添加 repo,但找不到对我有用的解决方案。

此外,我发现存储库 url 的结尾像这样 .git 但我的存储库地址只是这个 https://github.com/sonyzach/usfm-validator

  1. 如何在我的 package.json 中添加我的 repo url?
  2. package.json中需要添加哪些格式?

最佳答案

您可以使用任何编辑器打开 package.json 文件并在主对象中添加以下内容

"repository": {
    "type": "git",
    "url": "https://github.com/sonyzach/usfm-validator.git"
},

另外我认为你应该添加 .git 版本

关于node.js - 如何在 package.json 文件中添加 git repo,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43780250/

相关文章:

node.js - 当 Dockerfile 不在 Docker Hub 的根目录中时,出现 "COPY failed: no source files were specified"

git - 分支的交互式 rebase 及其与 master 的分歧点

linux - Git 尝试解析尚未设置的代理

git - 添加包含另一个子模块的 git 子模块?

已达到 GitHub Git-LFS 限制

node.js - 如何访问 package.json 配置部分?

javascript - Node.js lambda 函数重复进行 http 调用

node.js - 如何跨项目共享 npm 模块?

git - 清理 git 存储库中的二进制 blob

git - 查找未注明日期的提交日期?