How to resolve bower issue: “ENORESTARGET Tag/bran

2020-03-13 04:51发布

问题:

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...

回答1:

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)



回答2:

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



回答3:

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



回答4:

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.