[英]Install NPM package as Git clone
I'm working on a project that is using one of my own libraries as a dependency. 我正在一个项目中使用自己的库之一作为依赖项。 I'm still making lots of changes to my library and therefore I want to require my library as a Git clone. 我仍在对我的库进行很多更改,因此我想将我的库作为Git克隆。
From the NPM Install documentation get the impression that this is possible [1] but when I add my dependency and I run an npm install
the dependency is added without any of the Git information I require. 从NPM安装文档中可以感觉到这是可能的[1],但是当我添加依赖项并运行npm install
时,将添加依赖项而没有我需要的任何Git信息。
"dependencies": {
"mylib": "bitbucket:acme/mylib#dev-master"
},
How can I make NPM do a Git clone in my node_modules
directory rather then just getting the files? 如何使NPM在node_modules
目录中进行Git克隆而不是仅获取文件?
[1] https://docs.npmjs.com/cli/install [1] https://docs.npmjs.com/cli/install
You can check this answer , and modify it for your repo. 您可以检查此答案 ,并为您的仓库进行修改。 It works for almost all cases. 它适用于几乎所有情况。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.