How to install a bower package using a private git server (SSH)? How to install a bower package using a private git server (SSH)? git git

How to install a bower package using a private git server (SSH)?


Ok, found the solution here: Using Bower as the Package Management tool for Internal, Private Libraries. Simply remove git:// or ssh:// and add .git suffix:

"git@code.organization.com:projects/boilerplate-template.git#~1"


Also, if you're using Github and Bower for a private repo you can create a .netrc file if you need to run bower install on a remote server.

e.g. You have a DO droplet and need to checkout a git repo that uses ssh keys, but needs to run bower install with some deps that are private. If you add the .netrc file to your remote machine you will be good to go for deploys/builds.

// .netrc where someToken is generated in Github under Personal access tokenmachine github.com    login userName    password someToken


I had trouble getting bower login working, so I went with this approach. <TOKEN> is generated here. It works for private repositories hosted on Github.

"dependencies": {    "your-package": "https://<TOKEN>:x-oauth-basic@github.com/Account/Repository.git"}