Bower + private-bower + TFS (self hosted) with authentication

526 Views Asked by At

I am trying to create a Server for Bower (using private-bower from node js). I think, the problem is coming from the authentication on TFS (https://tfs.companyname.yyy/tfs/xxxxx). This server has for authentication basic auth.

Here is what I understood with the internet.

  • Create a git repo with your source files.
  • Push it to the server.
  • Create a .bowerrc => {"registry": "http://serverName:port"} (I am using localhost at the moment)
  • Execute the command to register your credential in git (also weird for me now) : git ls-remote --tags --heads "https:// tfs.companyname.yyy/tfs/xxx"
  • Execute the command "bower register package-name-here "git+https:// tfs.companyname.yyy/tfs/xxx"

I am stuck here without understanding the problem. The error is:

bower package-name-here#* resolve https:// tfs.companyname.yyy/tfs/xxx#*

bower package-name-here#* ECMDERR Failed to execute "git ls-remote --tags --heads https:// tfs.companyname.yyy/tfs/xxx", exit code of #128 bash: /dev/tty: No such device or address error: failed to execute prompt script (exit code 1) fatal: could not read Username for 'https:// tfs.companyname.yyy': Invalid argument

Additional error details: bash: /dev/tty: No such device or address error: failed to execute prompt script (exit code 1) fatal: could not read Username for 'https:// tfs.companyname.yyy': Invalid argument

2

There are 2 best solutions below

0
Lenny32 On BEST ANSWER

I managed to understand some problems by developing a micro bower server with 2 features (search and find the package).

Visual Studio 2015 is always displaying the official result (bower.herokuapp.com) in the GUI.

My .bowerrc (I think it has to be open as Bower do not support credentials)

  "registry": {
      "search": [
                   "http://bower.herokuapp.com",
                   "http://localhost:65200/"
      ]
  }

To add just modify the bower.json and to uninstall I didn't find a user friendly way so Right Click => Remove and remove it from the bower.json

1
Cece Dong - MSFT On

If you are using hosted TFS (VSTS), the URL should be like: https://example.visualstudio.com/_git/Repo_Name