Unable to make bower work on Windows #42

Closed
Anahkiasen opened this Issue Sep 12, 2012 · 37 comments

Projects

None yet
@Anahkiasen

I have the latest versions of Node, NPM and Bowser. Yet the simplest bower install jquery returns a Git error 127, same for all git:: paths, or trying to install a working Bower components.json I'm using on Mac at work.
I'm not sure where Bower is trying to download the .bower folder, didn't find anything anywhere with my files indexer. Any idea where it might be going wrong ?

@hoisel

I'm having the same problem on windows!!

@manuelvanrijn

Does this problem occur witin an existing repository? If so, can you check if this is also the problem within a newly created repository?

@martinnormark

I got the error as well, and it's due to git not being registered in the PATH environment variable.

Try to run the bower install jquery command from Git shell, and it works fine for me.

@Anahkiasen

Well no I mean I added git to my path, I use it all the time in Console 2 and never had problems.

@sapegin

I have something stranger on both win and mac. I can install components, but other commands (ls, uninstall, list) results in 127 error.

→ bower install underscore
bower cloning git://github.com/documentcloud/underscore.git
bower fetching underscore
bower cached git://github.com/documentcloud/underscore.git
bower checking out underscore#1.3.3
bower copying /Users/admin/.bower/underscore

→ bower uninstall underscore
bower error Git status: 127
bower error Git status: 127
@petebacondarwin

The bottom line is that child_process.spawn doesn't work well on windows. See npm/npm-www@98de54b.
This makes bower unusable on Windows.

@Iristyle

I'm on Windows 7 and not having any issues with Bower working.. shrug

I use Powershell, not cmd.. hosted in Console2.

@sapegin

I manually remove backbone and underscore and now all work fine. (I use Git Bash in Console2.)

@petebacondarwin
@joezimjs

I'm having the same issue on Windows 7 64bit. Works in Git Bash, but not in Powershell or Cmd. This is full of sadness. Though bower doesn't really seem to be saving me much time anyway. Just bookmark all the libraries I use often and then get the Raw file of the file I need to download. Bower still downloads the whole GitHub repository instead of just the files I need so it's wasting time.

@Iristyle

Well, if you give Bower a git url, it does a pull on the whole repo. My bigger issue is that it seems to ignore component.json, depending on some circumstances.

For instance, jQuery comes down correctly, but that's the only package I've tested that seems to work right (but maybe thats because the git url is only assets). I can understand why it wants to git clone to its local cache, but IMHO, it should read the main in component.json to figure out what to copy to your components\ dir at the very least. Instead it just does a checkout to the right tag, then blasts everything over.

I brought up the issue, but it was closed without much of an explanation.
#60

Right now it's very slow compared to the alternatives, so it would be nice for them to be able to figure out github urls automatically, like...

  • Get raw component.json at latest version / tag
  • Parse main ... figure out if files are local or stored elsewhere.
  • Grab raw files direct from GitHub rather than pulling an entire repo with history
  • Grab other files at urls specified

And yes, I realize not everyone uses GitHub ;0

@Anahkiasen

For the Twitter team to release something and not even test it on Windows, I enjoy Bower at work on my mac but that's not very serious guys. :/

@Iristyle

Some more discussion on the download the whole repo thing

#45

@sindresorhus
Bower member

For the Twitter team to release something and not even test it on Windows, I enjoy Bower at work on my mac but that's not very serious guys. :/

Why? It's Open Source and free. Instead of complaining, fix the issue yourself ;)

Expecting CLI tools to work perfectly on Windows out of the door, is like expecting IE6 to render todays web apps perfectly.

@Anahkiasen

Why? It's Open Source and free. Instead of complaining, fix the issue yourself ;)

If I could I would. The fact is Bower was released without being tested on an operating system that, as far as latest numbers show, is still ~70% of computers, whereas IE6 floats under the 10%.
There is a difference between complaining and simply underlining the haste in which Bower was released.

@sindresorhus
Bower member

I wasn't talking about percentage of users, I meant the extra work it requires to get something working on Windows.

Windows is IMHO an awful platform to develop CLI tools for, and it's only done because of demand.

Bower was quickly developed because of an immediate need. It's now our job to shape how it turns out.

@sapegin

is still ~70% of computers

70% of normal users, not developers :) It must be interesting to see how much web developers use Windows.

@Iristyle

I agree that one should not complain about free software -- if you want to use a developer tool, chances are good that you're a developer, and should at least be able to take a look into figuring out what went wrong. As mentioned, I'm on Windows and Bower is working just fine for me (even if I don't like how it downloads things ;0) -- node 0.8.8, under Powershell running on .NET 4.

However, I don't know that I agree that Windows is necessarily any more awful to develop CLI tools for than other platforms. Cmd line parsing libs for pretty much every language can normalize the differences, pretty much all languages have global constants for the path separator, and NPM has a simple technique for auto-generating cmd wrappers in node_modules\.bin . For node, of course there is ShellJS to simulate common Unix shell commands. Yes, if your tool depends on POSIX compliance, then you might have a bad time.

For whatever reason, I see a lot of my fellow Windows developers shying away from cmd line use though, so I can understand why it seems the effort isnt' worth it. Microsoft has had a pretty crappy command line story, and automating anything OS related has historically been a big PITA (I'm told Server 2012 has greatly improved this). It doesn't help that there's a lot of evangelism in the Microsoft world around point and click instead of learning how to use things, so I get it. On the other hand, PowerShell is an amazing (if underpublicized) shell -- better than Bash or Zsh IMHO (I use Bash regularly on our EC2 server VMs)... but of course, PS is not cross-platform, so it will never get widespread adoption.

So anyhow, I guess my point is... let's not hate on choice of OS, or on Twitter not testing for something that they don't really use. They built something useful, and gave it away for free. I can usually help out when it comes to Windows... but I'm not having any issues.

@roryf

As discussed in #67, for me this was caused by a faulty component.json, in my case the handlebars component. It specified a name of handlebars.js in component.json but seems to have been registered under the name handlebars. Installing manually using

bower install git://github.com/components/handlebars.js.git

fixed the problem for me.

Not sure how, but would be good if bower handled this better.

@vendethiel

I'm sorry if I bump into this with the wrong problem, but when I try (on W7) to install anything, I have :

> bower install jquery
bower cloning git://github.com/components/jquery.git
bower caching git://github.com/components/jquery.git
bower fetching jquery
bower error Git status: 1

Git is in my path and recognized in other CLI tools (like composer)

@satazor
Bower member

@Nami-Doc I also have win7 and everything works. If you got skype or gtalk we can work out together to solve the issue

@vendethiel

Thanks ! nami.doc on skype, nami.d0c.0 on gtalk - or even Vendethiel on #bower@freenode

@satazor
Bower member

After debugging stuff with @Nami-Doc, it turned out that was not a bower issue but something wrong with git on his system because its always exiting with code 1 on git fetch

@vendethiel

I'm affraid I had a problem with my version of msysgit.
Big thanks to @satazor !

@joezimjs

How do you solve the Git problem then?

@satazor
Bower member

In case of @Nami-Doc he reinstalled mysgit.

@joezimjs

I just went to http://msysgit.github.com/ and installed msysgit and it still doesn't work. I already had Git For Windows installed though. I don't know what's going on. I'm getting the status 127, not 1.

@petebacondarwin
@joezimjs

It "works" in the Git Bash shell, but now I'm getting a 128 status on some of the items (Backbone specifically). I'll have to check if that's already a covered issue.

@joezimjs

K, cleared the cache and it works. Apparently if you try installing something and get a 127, it still tries to pull from the cache and it doesn't work, so you get 128.

@satazor
Bower member

To make bower work in the normal Windows shell, you must ensure that git works from the command line. In the msys installtion wizard you must choose the right option (I think is the second one)

@joezimjs

Git does work from the command line for me, but I still have the 127 error when I use bower install from the command line.

@petebacondarwin
@joezimjs

Pete, you keep telling me to do that, and I do that, but that's not what we want, and that's not how the software is intended to work. And I've never had a problem with Node.js executing windows processes before so I really don't know what you're talking about. I've used child processes in several projects before and have had no problems.

@petebacondarwin
@joezimjs

Yes I have. In fact, I'm creating a web app that relies on it heavily and it has worked beautifully for me.

@monospaced monospaced referenced this issue in monospaced/angular-mousewheel May 22, 2013
Closed

bower install error on windows #1

@bobpaulin

This fixed the issue for me yeoman/yeoman#593

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment