I recently upgraded our TFS system to TFS 2013. I have a set of developers who develop some tools using NodeJS that are consumed internally. Previously, they had a source on the internal Gitorious server. The tools they developed are installed by other developers by running npm install with the URL of the Gitorious repository:
npm install git://gitorious.corp.local/project/repo.git
Since TFS 2013 supports our old TFVC and now has Git, we moved everyone to a single source control server. The team has migrated its repository and still wants to have an install command. Run similarly to this:
npm install git://tfs2013.corp.local:8080/tfs/DefaultCollection/TeamProject/_git/Repo
This does not work. Here's the error:
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
Does TFS support the Git protocol?
I tried the same command with http:
npm install http://tfs2013.corp.local:8080/tfs/DefaultCollection/TeamProject/_git/Repo
The error of this error is:
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
I could not find any information on how to configure the Git protocol in IIS or if it needs to be included in the TFS configuration.
Is it possible? I still need to find an article or word that says yes / no.
Our internal standards team really does not want to have several version control systems floating around, so I would really like to find out if this is a limitation of TFS 2013 and if future support is planned.
To some extent, can we do something with Node's package manager so that it works with TFS Git repositories?
EDIT / UPDATE
All Git commands, including actions with remote use of the HTTP , work correctly, clone, retrieve, pull, and click.
git clone http:
When using the following
git clone git://tfs2013.corp.local:8080/tfs/DefaultCollection/TeamProject/_git/Repo testDirectory
Fails:
Cloning into 'testDirectory'... fatal: protocol error: bad line length character: HTTP
Given the error caused by the npm command, I am not surprised that git clone fails when I use the git protocol.
My next step is to start firehark and see if I can get the response that TFS sends. I would prefer not to use wirehark, so if there is a suggestion to capture the answer in another way, I would appreciate it.
WIRESHARK EXIT - ANSWER FROM 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>
I wonder if I need to configure something in IIS for the Git protocol ...
UPDATE
It looks like this might be an NPM problem, not a problem with TFS. Using git: // implies ssh that does not support TFS 2013. I did not think about using wirehark in the http request. I should have known this, as he told me that the answer was 401, but the NPM request could not be authenticated!
I discovered the problem with NPM here: https://github.com/npm/npm/issues/7557