简体   繁体   English

依赖于package.json定义分支和标签

[英]Defining both branch and tag in dependancy of package.json

I'm using a Github repo as a dependancy in package.json in this format: 我正在使用Github存储库作为package.json中的依赖项,格式如下:

"dependencies": {
  "name": "https://github.com/user/repo.git#branch"
}

However, I'd also like to specify the v1.4.0 tag from that branch. 但是,我也想从该分支指定v1.4.0标记。 Is this possible, and how would I write it? 这可能吗,我该怎么写?

The NPM documentation explains using either a branch or a tag with # , but not both at the same time. NPM文档解释了使用一个分支或标签# ,但不能同时在同一时间。

Your git dependencies can be the sha1 of the commit id. 您的git依赖项可以是提交ID的sha1。

http://www.devthought.com/2012/02/17/npm-tricks/ http://www.devthought.com/2012/02/17/npm-tricks/

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

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