bower / bower

A package manager for the web
bower.io
MIT License
14.99k stars 1.85k forks source link

Meet an error when certain project needs certain version of compoment while the denpency with no version target #852

Closed thinksource closed 8 years ago

thinksource commented 10 years ago

I work on windows 7 I want use bower install the bootstrap since the bootstrap depend jquery, I install jquery first. Follow is my code:

git clone git://github.com/twbs/bootstrap.git cd bootstrap bower install jquery bower not-cached git://github.com/components/jquery.git#>= 1.9.0 bower resolve git://github.com/components/jquery.git#>= 1.9.0 bower not-cached git://github.com/components/jquery.git# bower resolve git://github.com/components/jquery.git# bower ENORESTARGET No tag found that was able to satisfy >= 1.9.0

Additional error details: No versions found in git://github.com/components/jquery.git

the jquery seems no version on github, while the bootstrap need jquery>=1.9.0

danielchatfield commented 10 years ago

You are not using bower correctly, execute bower install from the bootstrap folder and it will install bootstrap's dependencies

thinksource commented 10 years ago

still error!!!

F:\bower\bootstrap>bower install bower not-cached git://github.com/components/jquery.git#>= 1.9.0 bower resolve git://github.com/components/jquery.git#>= 1.9.0 bower ENORESTARGET No tag found that was able to satisfy >= 1.9.0

Additional error details: No versions found in git://github.com/components/jquery.git

danielchatfield commented 10 years ago

Delete the /bootstrap/bower_components folder.

Run (and post all the output): bower cache clean bower install -V bower install -v bower info jquery

thinksource commented 10 years ago

Still error!!!

F:\erase -R bootstrap F:\bower>bower cache clean F:\bower>bower install -v 1.2.6

F:\bower>bower install -V

F:\bower>bower info jquery bower not-cached git://github.com/components/jquery.git# bower resolve git://github.com/components/jquery.git# bower ENORESTARGET Tag/branch master does not exist

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

danielchatfield commented 10 years ago

Can you run git --version.

thinksource commented 10 years ago

F:\bower>git --version git version 1.8.3.msysgit.0

danielchatfield commented 10 years ago

I'm out of ideas now, for some reason bower is not communicating with the github repository properly - but everything seems to be in order.

satazor commented 10 years ago

@thinksource that's really strange. If you do git ls-remote --tags --heads git://github.com/components/jquery.git from your command prompt, do you get anything?

thinksource commented 10 years ago

F:\bower>git ls-remote --tags --heads git://github.com/components/jquery.git 6b2390db24ba3490ca75251eec4888f7342bf4da refs/heads/1.10 a94bf4baa9955613937d4f4c083c9d95ad0564fb refs/heads/1.8 0e94233e6a4ab678d8fc04312241b2f840717b0c refs/heads/1.9 452a56b52b8f4a032256cdb8b6838f25f0bdb3d2 refs/heads/master 7f83939b022aac9711d3a6895730a5df7865e277 refs/tags/1.10.0 24375b653868bcb18a6ca412c75914b964f8e439 refs/tags/1.10.1 6b2390db24ba3490ca75251eec4888f7342bf4da refs/tags/1.10.2 4a5e3575a6ba6617c069d2bf63952c9a54168599 refs/tags/1.2.3 69a439660918f50ffd660e5fef2fbaf915c5c534 refs/tags/1.2.3^{} 6a151502ad0b6fb48e37f49fc43136541e822681 refs/tags/1.2.6 35bb92f186cd564caf7afb9576cc82d1894673b7 refs/tags/1.2.6^{} 0e9a9bdfeb6400bf108b424a59fe19923185cf66 refs/tags/1.3.0 712b00c5b37fb6b103e4bd2b0117d1b707603742 refs/tags/1.3.0^{} 2c7262ce668f03c2c3b8982a5c0ab20c6a766b37 refs/tags/1.3.1 ab6e5344df3af52fcf4ce6418106ebb349113da1 refs/tags/1.3.1^{} f287e4825e7574fd8143b2fc1c7ec47b715a0ab7 refs/tags/1.3.2 9bbcf1cff971ed65220ce8c9bd9b12d85c00adc6 refs/tags/1.3.2^{} eb5dbfc06380b53be4e66db96fb8e807933cf0e5 refs/tags/1.4.0 67798540af45a8c03bc67b096e4cf090c82da24f refs/tags/1.4.0^{} 641c2e1361e84c1940c8bc33e55c66c8c8fcf515 refs/tags/1.4.1 1f141019965474662a03d68b013949a15edc6689 refs/tags/1.4.1^{} 69cabc1059ca19dddf3c610235ae4cc5ee5f720f refs/tags/1.4.2 f7e8db413768f2c455b861b71ef5c2bafcb41e12 refs/tags/1.4.2^{} e4910abe2a3e9d1b5ea89d77d89c3035cfb47e44 refs/tags/1.4.3 dbd68ad80e3201ec3a98a3e015099ce7dd33c411 refs/tags/1.4.3^{} 5bc90f83d9adc338e1c256472df18cc72b711a5c refs/tags/1.4.4 4d39db9d6436c17a3b3fcea7d228fd9489682a5b refs/tags/1.4.4^{} b2d81189401d9773c9f61cca93390ab68b8f49f7 refs/tags/1.5.0 c1bb4d3be04bdcdf0554257c2d70ae322dae57a3 refs/tags/1.5.0^{} b1e9f818e08d5b2c3676380b9483071fcee3f238 refs/tags/1.5.1 8ee908d74d37eca13e8f379dfdfeccbeffa2d166 refs/tags/1.5.1^{} b07313e7313b80988df01a77fbe060cb1eded2d0 refs/tags/1.5.2 d63afa9d0c98faee18677b79fa768b4fb5fb66f9 refs/tags/1.5.2^{} 534b849f50d1f24f6b44a433bc67b315cf2b0627 refs/tags/1.6.0 bc95af9d287bef9d58b55371f3950441bee23b82 refs/tags/1.6.0^{} 39a3a369d0ed321c3177d5e0fe3d0ee6dd47024e refs/tags/1.6.1 3248b95e0bccdd84aa81a288f50718ce6db5a774 refs/tags/1.6.1^{} 4e312a814e6b39d8332f170c73646bd96820b973 refs/tags/1.6.2 f33971d5371b8707ea4bedb6fb5c35e7cf34d87a refs/tags/1.6.2^{} cf41b2ce7d6e6c33449089f9727478514ea2e43f refs/tags/1.6.3 c29346c4299fa5b0425f011333a823840e031882 refs/tags/1.6.3^{} 01fcdbf8eb8b84e7710afcabf4e7d437aad41b45 refs/tags/1.6.4 58c542decb19098ac7177d0d624efbb71dbbad16 refs/tags/1.6.4^{} 4445fb8aca5d9a610dad61a7b73e9775d028b707 refs/tags/1.7.0 3ed09bf78c345d53be874b17944c38beda4bad72 refs/tags/1.7.0^{} 9d6ad70eb31f1136df4f329e74320a9cb279426f refs/tags/1.7.1 f5b567090d501380d1114598c8dfb83af9156182 refs/tags/1.7.1^{} 367dad7ed1a5162407af668905060c45cdd2d07a refs/tags/1.7.2 6fafaae81e1028b4fa7150e0ec75fd226f8fe977 refs/tags/1.7.2^{} 4e9640ecc75dfdf17fd514789d29889bf4b9869c refs/tags/1.8.0 a81132c96b530736a14a48aad3916b676d102368 refs/tags/1.8.0^{} 6d960102809f9cdef75aa28befe3986a70471792 refs/tags/1.8.1 76aee0eb13a7452203a40c7eafc800042ee2820f refs/tags/1.8.1^{} 4f101d6e569c2eadc8d59d07cba1bba0b212a0f1 refs/tags/1.8.2 a94bf4baa9955613937d4f4c083c9d95ad0564fb refs/tags/1.8.3 0ab056ce66caef94b1b5636a9fc9dc18d429b207 refs/tags/1.9.0 0e94233e6a4ab678d8fc04312241b2f840717b0c refs/tags/1.9.1 04d8a870773a9b3dce467db6e7662c888f9ff40b refs/tags/2.0.0 9cd2d580b0726cbe9a4062e1b158efe1d4d9de69 refs/tags/2.0.1 b237de4f9b286b792bb6649088654e732f4e2928 refs/tags/2.0.2 452a56b52b8f4a032256cdb8b6838f25f0bdb3d2 refs/tags/2.0.3

satazor commented 10 years ago

@thinksource That looks good. I've updated git to same version you are using on my windows VM and everything is working correctly. Do you mind to debug a little? Instructions:

1 - Clone bower to a folder 2 - Do npm link inside the cloned folder 3 - At this moment any calls to bower is running the cloned code! 4 - Add a console.log(refs) here https://github.com/bower/bower/blob/master/lib/core/resolvers/GitResolver.js#L302 5 - Run bower info jquery again and past the output of the console.log here

satazor commented 10 years ago

Hmm, it's an empty array!

bower resolve git://github.com/components/jquery.git#* [ '' ]

Strange. Add a console.log(stdout.toString()) here: https://github.com/bower/bower/blob/master/lib/core/resolvers/GitRemoteResolver.js#L184

If it reports an empty string, then, we have a problem in util/cmd.

thinksource commented 10 years ago

Yes, it reports an empty string.

F:\bower\bower\bin>bower info jquery bower not-cached git://github.com/components/jquery.git# bower resolve git://github.com/components/jquery.git#

[ '' ] bower ENORESTARGET Tag/branch master does not exist

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

danielchatfield commented 10 years ago

I don't know why I can't reproduce this, I have a ton of different laptops with different windows versions on them and none of them can reproduce this.

@thinksource which OS version do you have? Are you an administrator? Anti virus software?

On Wednesday, 4 September 2013, thinksource wrote:

Yes, it reports an empty string.

F:\bower\bower\bin>bower info jquery bower not-cached git://github.com/components/jquery.git# bower resolve git://github.com/components/jquery.git#

[ '' ] bower ENORESTARGET Tag/branch master does not exist

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

— Reply to this email directly or view it on GitHubhttps://github.com/bower/bower/issues/852#issuecomment-23831450 .

For contact info visit: www.danielchatfield.com

thinksource commented 10 years ago

I use windows 7 ultimate sp1 with an administrator account named ‘Sheng’ user. I also have another default administrator account named 'Administrator' on this laptop. no Auti-virus software applied

satazor commented 10 years ago

Does adding a console.log(data) here and here outputs anything?

satazor commented 10 years ago

Any chance that a firewall must be blocking bower?

danielchatfield commented 10 years ago

I thought that except it resolved it to the hit endpoint so it must have communicated with the bower registry and git on its own is communicating with GitHub so that seems unlikely.

On Wednesday, 4 September 2013, André Cruz wrote:

Any chance that a firewall must be blocking bower?

— Reply to this email directly or view it on GitHubhttps://github.com/bower/bower/issues/852#issuecomment-23832275 .

For contact info visit: www.danielchatfield.com

satazor commented 10 years ago

@danielchatfield yea, really strange!

thinksource commented 10 years ago

I have no firewall and close the default firewall. I change the 'console.log' to "console.log('cmd:'+data)" and "console.log('GitRemoteResolver:'+stdout.toString());" in order to make it clearly. it seems the command does not go through the util/cmd.js

F:\bower\bower\bin>bower info jquery bower not-cached git://github.com/components/jquery.git# bower resolve git://github.com/components/jquery.git# GitRemoteResolver: [ '' ] bower ENORESTARGET Tag/branch master does not exist

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

satazor commented 10 years ago

@thinksource it goes, but no output is captured from the git command. Lets try something here: https://github.com/bower/bower/blob/master/lib/core/resolvers/GitResolver.js#L19

do a console.log(which.sync('git')) there, it will print the path to git that bower is running. Is the path pointing to the correct git executable?

thinksource commented 10 years ago

@satazor This is the result, I also add some strings as target F:\bower\bower\bin>bower info jquery gitresolver:E:\Program Files (x86)\Git\cmd\git.EXE bower not-cached git://github.com/components/jquery.git# bower resolve git://github.com/components/jquery.git# GitRemoteResolver: [ '' ] bower ENORESTARGET Tag/branch master does not exist

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

satazor commented 10 years ago

Running E:\Program Files (x86)\Git\cmd\git.EXE ls-remote --tags --heads git://github.com/components/jquery.git in the same prompt you are running bower still outputs the tags/heads?

satazor commented 10 years ago

What version of node are you using? node -v

thinksource commented 10 years ago

@satazor yes the git.exe is correct path&name E:\Program Files (x86)\Git\cmd>git ls-remote --tags --heads git://github.com/com ponents/jquery.git 6b2390db24ba3490ca75251eec4888f7342bf4da refs/heads/1.10 a94bf4baa9955613937d4f4c083c9d95ad0564fb refs/heads/1.8 0e94233e6a4ab678d8fc04312241b2f840717b0c refs/heads/1.9 452a56b52b8f4a032256cdb8b6838f25f0bdb3d2 refs/heads/master 7f83939b022aac9711d3a6895730a5df7865e277 refs/tags/1.10.0 24375b653868bcb18a6ca412c75914b964f8e439 refs/tags/1.10.1 6b2390db24ba3490ca75251eec4888f7342bf4da refs/tags/1.10.2 4a5e3575a6ba6617c069d2bf63952c9a54168599 refs/tags/1.2.3 69a439660918f50ffd660e5fef2fbaf915c5c534 refs/tags/1.2.3^{} 6a151502ad0b6fb48e37f49fc43136541e822681 refs/tags/1.2.6 35bb92f186cd564caf7afb9576cc82d1894673b7 refs/tags/1.2.6^{} 0e9a9bdfeb6400bf108b424a59fe19923185cf66 refs/tags/1.3.0 712b00c5b37fb6b103e4bd2b0117d1b707603742 refs/tags/1.3.0^{} 2c7262ce668f03c2c3b8982a5c0ab20c6a766b37 refs/tags/1.3.1 ab6e5344df3af52fcf4ce6418106ebb349113da1 refs/tags/1.3.1^{} f287e4825e7574fd8143b2fc1c7ec47b715a0ab7 refs/tags/1.3.2 9bbcf1cff971ed65220ce8c9bd9b12d85c00adc6 refs/tags/1.3.2^{} eb5dbfc06380b53be4e66db96fb8e807933cf0e5 refs/tags/1.4.0 67798540af45a8c03bc67b096e4cf090c82da24f refs/tags/1.4.0^{} 641c2e1361e84c1940c8bc33e55c66c8c8fcf515 refs/tags/1.4.1 1f141019965474662a03d68b013949a15edc6689 refs/tags/1.4.1^{} 69cabc1059ca19dddf3c610235ae4cc5ee5f720f refs/tags/1.4.2 f7e8db413768f2c455b861b71ef5c2bafcb41e12 refs/tags/1.4.2^{} e4910abe2a3e9d1b5ea89d77d89c3035cfb47e44 refs/tags/1.4.3 dbd68ad80e3201ec3a98a3e015099ce7dd33c411 refs/tags/1.4.3^{} 5bc90f83d9adc338e1c256472df18cc72b711a5c refs/tags/1.4.4 4d39db9d6436c17a3b3fcea7d228fd9489682a5b refs/tags/1.4.4^{} b2d81189401d9773c9f61cca93390ab68b8f49f7 refs/tags/1.5.0 c1bb4d3be04bdcdf0554257c2d70ae322dae57a3 refs/tags/1.5.0^{} b1e9f818e08d5b2c3676380b9483071fcee3f238 refs/tags/1.5.1 8ee908d74d37eca13e8f379dfdfeccbeffa2d166 refs/tags/1.5.1^{} b07313e7313b80988df01a77fbe060cb1eded2d0 refs/tags/1.5.2 d63afa9d0c98faee18677b79fa768b4fb5fb66f9 refs/tags/1.5.2^{} 534b849f50d1f24f6b44a433bc67b315cf2b0627 refs/tags/1.6.0 bc95af9d287bef9d58b55371f3950441bee23b82 refs/tags/1.6.0^{} 39a3a369d0ed321c3177d5e0fe3d0ee6dd47024e refs/tags/1.6.1 3248b95e0bccdd84aa81a288f50718ce6db5a774 refs/tags/1.6.1^{} 4e312a814e6b39d8332f170c73646bd96820b973 refs/tags/1.6.2 f33971d5371b8707ea4bedb6fb5c35e7cf34d87a refs/tags/1.6.2^{} cf41b2ce7d6e6c33449089f9727478514ea2e43f refs/tags/1.6.3 c29346c4299fa5b0425f011333a823840e031882 refs/tags/1.6.3^{} 01fcdbf8eb8b84e7710afcabf4e7d437aad41b45 refs/tags/1.6.4 58c542decb19098ac7177d0d624efbb71dbbad16 refs/tags/1.6.4^{} 4445fb8aca5d9a610dad61a7b73e9775d028b707 refs/tags/1.7.0 3ed09bf78c345d53be874b17944c38beda4bad72 refs/tags/1.7.0^{} 9d6ad70eb31f1136df4f329e74320a9cb279426f refs/tags/1.7.1 f5b567090d501380d1114598c8dfb83af9156182 refs/tags/1.7.1^{} 367dad7ed1a5162407af668905060c45cdd2d07a refs/tags/1.7.2 6fafaae81e1028b4fa7150e0ec75fd226f8fe977 refs/tags/1.7.2^{} 4e9640ecc75dfdf17fd514789d29889bf4b9869c refs/tags/1.8.0 a81132c96b530736a14a48aad3916b676d102368 refs/tags/1.8.0^{} 6d960102809f9cdef75aa28befe3986a70471792 refs/tags/1.8.1 76aee0eb13a7452203a40c7eafc800042ee2820f refs/tags/1.8.1^{} 4f101d6e569c2eadc8d59d07cba1bba0b212a0f1 refs/tags/1.8.2 a94bf4baa9955613937d4f4c083c9d95ad0564fb refs/tags/1.8.3 0ab056ce66caef94b1b5636a9fc9dc18d429b207 refs/tags/1.9.0 0e94233e6a4ab678d8fc04312241b2f840717b0c refs/tags/1.9.1 04d8a870773a9b3dce467db6e7662c888f9ff40b refs/tags/2.0.0 9cd2d580b0726cbe9a4062e1b158efe1d4d9de69 refs/tags/2.0.1 b237de4f9b286b792bb6649088654e732f4e2928 refs/tags/2.0.2 452a56b52b8f4a032256cdb8b6838f25f0bdb3d2 refs/tags/2.0.3

My node is v0.10.17 E:\Program Files (x86)\Git\cmd>node -v v0.10.17

satazor commented 10 years ago

I'm getting out of ideas. Assuming the following console log's are still there:

Does adding a console.log(data) here and here outputs anything?

Can you remove this line and see if any output from the git command gets eventually outputted?

thinksource commented 10 years ago

yes the console.log(data) still here, but don't output anything. I remove the line process.exit(1); the git command still work correcrly and the bower info command still same output

F:\bower\bower\bin>bower info jquery gitresolver:E:\Program Files (x86)\Git\cmd\git.EXE bower not-cached git://github.com/components/jquery.git# bower resolve git://github.com/components/jquery.git# GitRemoteResolver: [ '' ] bower ENORESTARGET Tag/branch master does not exist

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

thinksource commented 10 years ago

hi, I added some console.info try to output something and I seems find where the problem is. the key staff is add console.log('cmd:'+getWindowsCommand(command)); console.log('cmd:process.platform='+process.platform); at line 52 of your cmd.js

F:\bower\bower\bin>bower info jquery gitresolver:E:\Program Files (x86)\Git\cmd\git.EXE cmd:git bower error Cannot read property 'platform' of undefined

Stack trace: TypeError: Cannot read property 'platform' of undefined at cmd (F:\bower\bower\lib\util\cmd.js:53:45) at Function.GitRemoteResolver.refs (F:\bower\bower\lib\core\resolvers\GitRem oteResolver.js:181:13) at Function.GitResolver.tags (F:\bower\bower\lib\core\resolvers\GitResolver. js:300:18) at Function.GitResolver.versions (F:\bower\bower\lib\core\resolvers\GitResol ver.js:260:18) at PackageRepository. (F:\bower\bower\lib\core\PackageRepository. js:124:33) at F:\bower\bower\node_modules\q\q.js:1186:26 at _fulfilled (F:\bower\bower\node_modules\q\q.js:798:54) at self.promiseDispatch.done (F:\bower\bower\node_modules\q\q.js:827:30) at Promise.promise.promiseDispatch (F:\bower\bower\node_modules\q\q.js:760:1 3) at F:\bower\bower\node_modules\q\q.js:526:49

Console trace: Trace at StandardRenderer.error (F:\bower\bower\lib\renderers\StandardRenderer.js: 74:17) at Logger.updateNotifier.packageName (F:\bower\bower\bin\bower:111:18) at Logger.EventEmitter.emit (events.js:95:17) at Logger.emit (F:\bower\bower\node_modules\bower-logger\lib\Logger.js:29:39 ) at F:\bower\bower\lib\commands\info.js:35:16 at _rejected (F:\bower\bower\node_modules\q\q.js:808:24) at F:\bower\bower\node_modules\q\q.js:834:30 at Promise.when (F:\bower\bower\node_modules\q\q.js:1079:31) at Promise.promise.promiseDispatch (F:\bower\bower\node_modules\q\q.js:752:4 1) at F:\bower\bower\node_modules\q\q.js:574:44

System info: Bower version: 1.2.6 Node version: 0.10.17 OS: Windows_NT 6.1.7601 x64 bower not-cached git://github.com/components/jquery.git# bower resolve git://github.com/components/jquery.git# cmd:git

You can see I can get the git command properly, but I can not get the process.platform in your code you have:

if (isWin) {
    command = getWindowsCommand(command);
}

the isWin is depending on process.platform, if process.platform is undefined, you do not get the command, so the command execution part is nothing output.

thinksource commented 10 years ago

Hi, not only the process.platform, but also the process variable is not defined,

I change https://github.com/bower/bower/blob/master/lib/util/cmd.js#L59 to
// Buffer output, reporting progress console.log('cmd:process='+process); process = cp.spawn(command, args, options); console.log('cmd:process='+process);

and the execute result: F:\bower\bower\bin>bower info jquery gitresolver:E:\Program Files (x86)\Git\cmd\git.EXE cmd:process=undefined cmd:process=[object Object] bower not-cached git://github.com/components/jquery.git# bower resolve git://github.com/components/jquery.git# GitRemoteResolver: [ '' ] bower ENORESTARGET Tag/branch master does not exist

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

you can see the parent process is undefined, only the child process defined.

satazor commented 10 years ago

@thinksource process is a global variable, but inside the cmd() function it gets redefined locally. You can rename the process var to something else to see if that's the problem but you will see it isn't.

satazor commented 10 years ago

@thinksource Are you using the normal cmd.exe terminal? or are you using some other windows prompt?

thinksource commented 10 years ago

@satazor I am using normal cmd.exe But I installed visual studio 2012 and cywin, I am not sure those software will change the prompt of normal cmd.exe or not.

from my test you can see it obviously, before the cp.spawn(command, args, options); the process did not initialize, after this command line the process begin to be object, which means it already initialized.

thinksource commented 10 years ago

I change 'process' to 'processc' and added some info outputs.

gitresolver:E:\Program Files (x86)\Git\cmd\git.EXE logger:[object Object] logger.json:undefined { cwd: 'F:\bower\bower', directory: 'bower_components', registry: { search: [ 'https://bower.herokuapp.com' ], register: 'https://bower.herokuapp.com', publish: 'https://bower.herokuapp.com' }, shorthandResolver: 'git://github.com/{{owner}}/{{package}}.git', tmp: 'C:\Users\Sheng\AppData\Local\Temp\Sheng-pc-Sheng\bower', timeout: 30000, ca: { search: [] }, strictSsl: true, userAgent: 'node/v0.10.17 win32 x64', color: true, storage: { packages: 'C:\Users\Sheng\AppData\Roaming\bower\cache\packages', links: 'C:\Users\Sheng\AppData\Roaming\bower\data\links', completion: 'C:\Users\Sheng\AppData\Roaming\bower\data\completion', registry: 'C:\Users\Sheng\AppData\Roaming\bower\cache\registry', empty: 'C:\Users\Sheng\AppData\Roaming\bower\data\empty' }, interactive: true, argv: { remain: [ 'info', 'jquery' ], cooked: [ 'info', 'jquery' ], original: [ 'info', 'jquery' ] } } cmd:process=undefined cmd:processc=[object Object] bower not-cached git://github.com/components/jquery.git# bower resolve git://github.com/components/jquery.git# GitRemoteResolver: [ '' ] bower ENORESTARGET Tag/branch master does not exist

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

thinksource commented 10 years ago

I can visit process individually, but in your program the process show undefined.

F:\Kepler\zentasks>node

process.platform 'win32'

F:\bower\bower\bin>bower info jquery gitresolver:E:\Program Files (x86)\Git\cmd\git.EXE logger:[object Object] logger.json:undefined cmd:process=undefined cmd:processc=[object Object] bower not-cached git://github.com/components/jquery.git# bower resolve git://github.com/components/jquery.git# GitRemoteResolver: [ '' ] bower ENORESTARGET Tag/branch master does not exist

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

satazor commented 10 years ago

@thinksource As I said, that's not the issue.. otherwise it wouldn't be working for all of us right? The issue here is something related to node not communicating correctly with spawned commands in your environment.

The following is a decoupled code that executes the git command that is failing inside bower.

var cp = require('child_process');

var spawned = cp.spawn('git', ['ls-remote', '--tags', '--heads', 'git://github.com/components/jquery.git']);
spawned.stdout.on('data', function (data) {
    console.log(data.toString());
});
spawned.stderr.on('data', function (data) {
    console.log(data.toString());
});

spawned.on('error', function (error) {
    console.log(error.message);
});

spawned.on('close', function (code) {
    console.log('exited', code);
});

Create a test.js file with that and run node test.js. You will probably get no output either.

didxga commented 10 years ago

@thinksource I got a very similar problem, I solved it by this way: change git protocol from git to https by executing git config --global url."https://".insteadOf git:// then bower install jquery works!

thasmo commented 10 years ago

Had a similar problem when trying to install swfobject: "swfobject": "~2.2"

I could only solve it by defining a concrete version: "swfobject": "2.3-beta+rc1"

rangerch commented 10 years ago

@didxga I got same problem, thanks for your help, and i dont know why the team of Bower didnt solve this problem at new version.

htoooth commented 10 years ago

@didxga Thanks for your answer

eldrgeek commented 9 years ago

Found a solution and posted it here

Short form:

 rm bower.json
 bower init
oneezy commented 9 years ago

not working for me either. tried all above suggestions.

stevenvachon commented 9 years ago

I'm getting this problem too. Changing the version in bower.json to "latest" seems to work for now. When I do: bower info steal-myth, it has no version, yet the file on the repo clearly has one.

Silly me, my GitHub repo did not have a "release"; only a version in bower.json

Perhaps you guys are encountering the same issue?

KidA001 commented 9 years ago

This issue was happening for me and was due to the bower.json bootstrap-sass version being set to 2.3.1 which was not an available release according to bower. I opened my bower.json and changed it to 3.1.0 and it seems to be working now. Hope this might help someone else.

wheany commented 9 years ago

I had a similar problem with ember#1.10.0 So then I tried bower install --save ember#1.11.0-beta.5 which worked. I then retried bower install --save ember#1.10.0 and it complained: Unable to find a suitable version for ember, please choose one: 4) ember#1.10.0 which resolved to 1.10.0 [other lines omitted]

I selected 4 and suddenly it worked. I have no idea why.

llbbl commented 8 years ago

adding a bower version to the package.json file fixed it for me.... even thou you STILL have to install it globally

Either this

  "dependencies": {
    "bower": "~1.4.1"
  },

or This will work

  "dependencies": {
    "bower": "*"
  },

Well actually not totally sure that will fix the error for you all because I was getting it when I ran npm install... so hopefully that fixes it for you and sorry if not.

m0n1ker commented 8 years ago

I found this thread after I experienced some of the same error messages. I found a solution that could be of interest to some users and thought I'd post it here.

When using ConEmu on Windows (Which is a pretty popular terminal replacement) the default option to "Inject ConEmuHk" causes bower to malfunction. For instance, when I go to install jQuery, it will only recognize the 1.x tags. When I un-check the inject option, it recognizes all of the tags.

I'm not sure whether the problem is with ConEmu's DLL or with bower, but I though I would mention this either way. When running git ls-remote all of the remote tags are listed properly.

Bower: v1.5.2 Git: v2.5.3

EDIT: Ok, I did some debugging and for those that are having issues with ConEmu, the issue is not with bower. Where bower makes the call value = cmd('git', ['ls-remote', '--tags', '--heads', source]).spread(function (stdout) { in GitRemoteResolver.js the stdout variable is getting truncated to 4096 characters. This is a bug in the ConEmuHk DLL.

kvickyk commented 8 years ago

m0n1ker thank you for that. It solved my problems. I kept doing everything in ComEmu and kept hitting this issue for the last two weeks.

grafikkaos commented 8 years ago

oh boy... @m0n1ker , thank you so much for this solution. I use cmder and after unticking the "Inject ConEmuHk" option, i have been able to install / update my bower packages :+1:

sheerun commented 8 years ago

Closing as it seems it's not an issue with bower, but ConEmuHk as @m0n1ker said..

vabc commented 8 years ago

Hello, after a few hours searching a solution for the same problem I found this blog. I am just trying to execute the simple bower.json file:

{ "name": "angular-phonecat", "description": "A starter project for AngularJS", "version": "0.0.0", "homepage": "https://github.com/angular/angular-phonecat", "license": "MIT", "private": true, "dependencies": { "angular": "1.4.x", "angular-mocks": "1.4.x", "jquery": "~2.1.1", "bootstrap": "~3.1.1", "angular-route": "1.4.x", "angular-resource": "1.4.x", "angular-animate": "1.4.x" } }

and always the answer was:

bower install

bower not-cached git://github.com/angular/bower-angular.git# bower resolve git://github.com/angular/bower-angular.git# bower not-cached git://github.com/twbs/bootstrap.git# bower resolve git://github.com/twbs/bootstrap.git# bower not-cached git://github.com/angular/bower-angular-mocks.git# bower resolve git://github.com/angular/bower-angular-mocks.git# bower not-cached git://github.com/jquery/jquery.git# bower resolve git://github.com/jquery/jquery.git# bower not-cached git://github.com/angular/bower-angular-route.git# bower resolve git://github.com/angular/bower-angular-route.git# bower not-cached git://github.com/angular/bower-angular-resource.git# bower resolve git://github.com/angular/bower-angular-resource.git# bower not-cached git://github.com/angular/bower-angular-animate.git# bower resolve git://github.com/angular/bower-angular-animate.git# bower ENORESTARGET Tag/branch master does not exist

Finally! I put a similar dependencies inside a file package.json and i executed it with npm.

Then everything worked perfectly!

sheerun commented 8 years ago

Please look at @grafikkaos comment for solution of this problem https://github.com/bower/bower/issues/852#issuecomment-145169743