11

I cannot seem to get bower working on my current project. The project began as a yeoman 'angular' app a couple weeks ago, and now cannot remember exactly what I did, nor can I determine how to fix it.

I do not have a bower_components directory, and have deleted and re-created bower.js several times.

bower.json

{
  "name": "my_name",
  "version": "0.0.0",
  "main": "app/index.html",
  "license": "MIT",
  "private": true
}

$ bower install jquery

bower jquery#*                  cached git://github.com/jquery/jquery.git#2.1.1
bower jquery#*                validate 2.1.1 against git://github.com/jquery/jquery.git#*
bower jquery#*            ENORESTARGET Tag/branch master does not exist

Additional error details:
No tags found in git://github.com/jquery/jquery.git
No branches found in git://github.com/jquery/jquery.git

It looks like this error is telling me that the jquery project doesn't have a master branch? (it does)

I created a fresh project, and did a bower init, then ran the same command (bower install jquery). Doing this works as expected, and jquery is installed without error.

$ bower install jquery

bower jquery#*                  cached git://github.com/jquery/jquery.git#2.1.1
bower jquery#*                validate 2.1.1 against git://github.com/jquery/jquery.git#*
bower jquery#~2.1.1            install jquery#2.1.1

jquery#2.1.1 bower_components/jquery

I still cannot get my original project to work.

What is it that is causing this problem, and how can I resolve it?


UPDATE

I was able to resolve this issue by deleting all the hidden .git* files.

  • contents of .git/
  • .gitignore
  • .gitattributes

I guess it follows that somehow git was caching something incorrectly? I'd really like to know what it was causing it to not work properly. I'll leave this question open for a bit in case someone has any insight as to what the cause of all this is. Otherwise I'll answer myself a bit later on...

Community
  • 1
  • 1
Zach Lysobey
  • 14,959
  • 20
  • 95
  • 149
  • I also have this issue. My message is: bower ENORESTARGET Tag/branch current does not exist And I don't use git on this project. – Stephane Aug 10 '14 at 09:50
  • @StephaneEybert probably worth opening your own question for it then... link it here if you want and I'll take a look. – Zach Lysobey Aug 11 '14 at 15:02
  • I have solved the issue, but my memory is blurry on this :-) I think I deleted the bower_components directory. – Stephane Aug 12 '14 at 17:04

4 Answers4

12

if you use cmder or ConEmu (both are simple terminal commander) go to options and uncheck "Inject ConEmuHk" option, your problem will be resolve ...!

more info : main response(in near of last answer)

sajjad
  • 646
  • 1
  • 9
  • 20
4

Be careful ! it can be your command line tool that causes this problem. For me the problem was resolved using ConEmu and the bug was caused by a version of Cmder

Yassin
  • 1,376
  • 18
  • 18
1

This happened to me from within a Jenkins build, and wiping out the workspace did the trick for me.

freethejazz
  • 2,235
  • 14
  • 19
0

I had the same problem, and removed the git files as suggested in a previous answer.

NG.

Then I removed bower.json. That fixed the problem.

Fortunately I work in a VM environment and fortunately I took a snapshot before I started deleting stuff (highly recommended practice). So I restored the snapshot and applied the right fix:

  rm bower.json
  bower init

bower init asks a bunch of questions. I pretty much took the defaults. It restored my bower.json dependencies based on what I had already installed in bower_components

Voila!

My unloadable package now loads.

WolfReporter
  • 537
  • 4
  • 3