2

I have a git project which contains a bower.json file which contains several dependencies. It looks like this:

//module1
"dependencies": {
    "devbridge-autocomplete": "devbridge/jQuery-Autocomplete#~1.2.21",
    "backbone": "~1.2.1",
    "underscore": "~1.8.3",
    "jquery": "~2.1.4",
    "module2": "gitUser/module2",
    "module3": "gitUser/module3"
  }

problem is when I run bower install --save gitUser/module1 bower does not pull the latest commits from github, and only pulls the initial commit.

bower.json of module2 and 3 are essentially similar:

{
  "name": "module2",
  "main": "module2.js",
  "version": "0.0.0",
  "authors": [
    "gitUser <gitUser@gitUser.com>"
  ],
  "moduleType": [
    "amd"
  ],
  "license": "MIT",
  "ignore": [
    "**/.*",
    "node_modules",
    "bower_components",
    "directory/bower_components",
    "test",
    "tests"
  ]
}

the cloned repositories hidden .bower.json looks like:

{
  "name": "module2",
  "_cacheHeaders": {
    "Content-Type": "text/html; charset=utf-8"
  },
  "main": "index",
  "_source": "https://github.com/gitUser/module2",
  "_target": "*",
  "_originalSource": "https://github.com/gitUser/module2"
}

I have also unsuccessfully tried installing dependencies in module1 by:

bower install --save gitUser/module2#latest

I have also tried adding git tags to each sub module, but this also did not work. I saw this issue, so the tagging should not matter.

Any assistance appreciated!

AlBlue
  • 23,254
  • 14
  • 71
  • 91
andrsnn
  • 1,591
  • 5
  • 25
  • 43
  • Have you made a "release" on GitHub for module1? – EM-Creations Jul 10 '15 at 07:42
  • I was hoping to avoid making a release. I think I was attempting to use bower as both a dependency manager AND a way to manage my git workflow on some sub modules that were dependencies but also were in development. In regards to the problem above, uninstalling dependencies and purging the cache multiple times seems to eventually get it working, although the problem still consistently happens. I will troubleshoot and post my solution. – andrsnn Jul 15 '15 at 01:06
  • The instructions to set up your code to work with bower does say that you need to create a "release" on GitHub, this is how it keeps track of the version you're using etc.. – EM-Creations Jul 15 '15 at 07:15

1 Answers1

2

If you want the latest commit from a specific branch:

bower install --save gitUser/module2#specific_branch_name

If you want a specific commit:

bower install --save gitUser/module2#specific_commit_id
YPCrumble
  • 26,610
  • 23
  • 107
  • 172