admin管理员组文章数量:1332107
I'm trying to get npm to install node-gitteh
as a dependency via npm install
which reads from package.json
. Unfortunately this npm package is broken in node 0.6.x, but no problem as there's a forked repo that fixes the issues (.git).
Now the issue is that this forked repo has a submodule, so if I try to download the tar from github in the package.json
:
, "dependencies" : {
"gitteh" : ";
}
I get an error that equates to "submodule folder not found". If I clone the same repo manually and do a recursive submodule update and an npm install
from the node-gitteh
folder, it works fine, but I can't figure out how to get npm to do this.
I'm trying to get npm to install node-gitteh
as a dependency via npm install
which reads from package.json
. Unfortunately this npm package is broken in node 0.6.x, but no problem as there's a forked repo that fixes the issues (https://github./hughsk/node-gitteh.git).
Now the issue is that this forked repo has a submodule, so if I try to download the tar from github in the package.json
:
, "dependencies" : {
"gitteh" : "https://github./hughsk/node-gitteh/tarball/master"
}
I get an error that equates to "submodule folder not found". If I clone the same repo manually and do a recursive submodule update and an npm install
from the node-gitteh
folder, it works fine, but I can't figure out how to get npm to do this.
2 Answers
Reset to default 6I've had the same problem and so far have just relied on cloning my module into node_modules and doing a submodule update manually. It would be nice to have npm handle this automatically.
In package.json there's a scripts field (see npm docs) So could do
"scripts":{"preinstall": "git submodule update -i -r"}
See https://github./isaacs/octave-test for an example of this.
According to the docs, you need to supply the git url in a special format.
Also, it needs to point to git repo (same address you would use for git clone
), not the tarball provided by github.
In your case (git over https), it would be:
, "dependencies" : {
"gitteh" : "git+https://github./hughsk/node-gitteh"
}
Using this, npm will default to the master branch.
本文标签: javascriptnpm install forked git with submoduleStack Overflow
版权声明:本文标题:javascript - npm install forked git with submodule - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742225111a2436168.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论