npm git协议依赖关系 [英] npm git protocol dependencies

查看:236
本文介绍了npm git协议依赖关系的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在工作中,我们在一个HTTP代理之后,并且git协议(端口9418)被拒绝。
我的项目具有NPM依赖性,其中一些依赖项具有使用git协议的依赖项,例如:



在我的包中。 json

 dependencies:{
jsdoc3:git + https: //github.com/jsdoc3/jsdoc.git

package.json jsdoc3:

 dependencies:{
crypto-browserify:git://github.com/dominictarr/crypto-browserify.git#95c5d505,
github-flavored-markdown:git://github.com/hegemonic/github -flavored-markdown.git
}

如何获得这些依赖关系,如何告诉NPM使用 git + https:// 协议而不是 git:// 协议或能够使用git协议?

为了简化我在Windows上的工作(在Linux上创建SSH隧道会更容易),并使用GIT-Bash。 p>

谢谢

解决方案

您可以通过以下命令告诉git使用https而不是git://:

  git config --global url。https://.insteadOf git:// 


At work we are behind an HTTP Proxy and the git protocol (port 9418) is denied. My project has NPM dependencies and some of these dependencies have dependencies that use the git protocol, for instance:

In my package.json

"dependencies": {
    "jsdoc3" : "git+https://github.com/jsdoc3/jsdoc.git"
}

and the package.json of jsdoc3:

"dependencies": {
    "crypto-browserify": "git://github.com/dominictarr/crypto-browserify.git#95c5d505",
    "github-flavored-markdown": "git://github.com/hegemonic/github-flavored-markdown.git"
}

How can I get those dependencies, how to tell NPM to use git+https:// protocol instead of git:// protocol or to be able to use the git protocol?

To simplify things I'm on windows (it would be easier on Linux to create an SSH tunnel), and I use GIT-Bash.

Thanks

解决方案

You can tell git to use https instead of git:// with the following command:

git config --global url."https://".insteadOf git://

这篇关于npm git协议依赖关系的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆