Mik*_*e G 5 git tfs node.js npm tfs2013
我最近将我们的TFS系统升级到TFS 2013.我有一组开发人员正在使用NodeJS开发一些内部消耗的工具.他们以前在内部Gitorious服务器上有他们的来源.他们开发的工具由其他开发人员通过npm install使用Gitorious repo url 运行安装:
npm install git://gitorious.corp.local/project/repo.git
Run Code Online (Sandbox Code Playgroud)
由于TFS 2013支持我们的旧TFVC,现在有了Git,我们已经将每个人都移到了一个源控制服务器上.该团队已迁移其存储库,但仍希望能够拥有install命令.运行类似于:
npm install git://tfs2013.corp.local:8080/tfs/DefaultCollection/TeamProject/_git/Repo
Run Code Online (Sandbox Code Playgroud)
这似乎不起作用.这是错误:
npm ERR! git clone git://tfs2013.corp.local:8080/tfs/DefaultCollection/TeamProject/_git/Repo Cloning into bare repository 'C:\npm-cache\_git-remotes\git-tfs-8080-tfs-DefaultCollection-Project-git-repo-fbbf0c4b'...
npm ERR! git clone git://tfs2013.corp.local:8080/tfs/DefaultCollection/TeamProject/_git/Repo
npm ERR! git clone git://tfs2013.corp.local:8080/tfs/DefaultCollection/TeamProject/_git/Repo fatal: protocol error: bad line length character: HTTP
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "git://tfs2013.corp.local:8080/tfs/DefaultCollection/TeamProject/_git/Repo"
npm ERR! node v0.10.35
npm ERR! npm v2.4.1
npm ERR! code 128
npm ERR! Command failed: fatal: protocol error: bad line length character: HTTP
npm ERR!
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <http://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR! C:\Source\git\sumtotal-module\npm-debug.log
Run Code Online (Sandbox Code Playgroud)
TFS是否支持git协议?
我用http尝试了同样的命令:
npm install http://tfs2013.corp.local:8080/tfs/DefaultCollection/TeamProject/_git/Repo
Run Code Online (Sandbox Code Playgroud)
它失败并出现此错误:
npm ERR! fetch failed http://tfs2013.corp.local:8080/tfs/DefaultCollection/TeamProject/_git/Repo
npm WARN retry will retry, error on last attempt: Error: fetch failed with status code 401
npm ERR! fetch failed http://tfs2013.corp.local:8080/tfs/DefaultCollection/TeamProject/_git/Repo
npm WARN retry will retry, error on last attempt: Error: fetch failed with status code 401
Run Code Online (Sandbox Code Playgroud)
我无法找到有关如何在IIS中设置git协议的任何信息,或者是否需要在TFS的配置中启用它.
这可能吗?我还没有找到一篇关于是/否的文章或文字.
我们的内部标准团队真的不希望有多个版本控制系统浮动,所以我真的想弄清楚这是否是TFS 2013的限制以及是否有计划的未来支持.
在某种程度上,我们可以使用Node的软件包管理器来使其与TFS的git存储库一起使用吗?
编辑/ UPDATE
涉及使用HTTP协议对远程操作的所有git命令都正常工作,克隆,获取,拉取和推送.
git clone http://tfs2013.corp.local:8080/tfs/DefaultCollection/TeamProject/_git/Repo
Run Code Online (Sandbox Code Playgroud)
使用时执行以下操作
git clone git://tfs2013.corp.local:8080/tfs/DefaultCollection/TeamProject/_git/Repo testDirectory
Run Code Online (Sandbox Code Playgroud)
它失败:
Cloning into 'testDirectory'...
fatal: protocol error: bad line length character: HTTP
Run Code Online (Sandbox Code Playgroud)
鉴于npm命令产生的错误,git clone当我使用git协议时失败并不会感到惊讶.
我的下一步是启动wireshark,看看我是否能得到TFS发送的响应.我宁愿不使用wireshark所以如果有建议以另一种方式获取响应,我会很感激.
WIRESHARK输出 - TFS的响应
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
<HTML><HEAD><TITLE>Bad Request</TITLE>
<META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii"></HEAD>
<BODY><h2>Bad Request - Invalid URL</h2>
<hr><p>HTTP Error 400. The request URL is invalid.</p>
</BODY></HTML>
Run Code Online (Sandbox Code Playgroud)
想知道我是否需要在IIS中为git协议设置任何东西......
UPDATE
看起来这可能是NPM问题而不是TFS问题.使用git://表示TFS 2013 不支持的ssh .我没想到在http请求中使用wireshark.我应该知道这是因为它告诉我响应是401但是NPM的请求无法通过身份验证!
我在这里打开了NPM的问题:https://github.com/npm/npm/issues/7557
| 归档时间: |
|
| 查看次数: |
584 次 |
| 最近记录: |