繁体   English   中英

从git安装NPM软件包时是否可以克隆git存储库?

[英]Is it possible to clone the git repositories when installing NPM packages from git?

我有一个像这样的package.json

{
  "name": "test",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "dependencies": {
      "some-module": "git+ssh://git@github.com/IonicaBizau/some-module.git"
  },
  "author": "",
  "license": "ISC"
}

当我执行npm install所有内容都安装正确,但我也希望通过克隆存储库从我的存储库安装软件包,所以在node_modules/some-module我将从GitHub克隆一个git存储库。

我怎样才能做到这一点? 是否有内置选项或我应该构建自己的工具?

我创建了gpm - 一个从git安装依赖项的工具。

git + npm === gpm


要安装gpm do:

npm i -g gpm

然后你可以这样做:

gpm -i some-module

这将以递归方式从git存储库安装依赖项。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM