Unable to make bower work on Windows #42

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

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

This comment has been minimized.

Show comment
Hide comment
@hoisel

hoisel Sep 12, 2012

I'm having the same problem on windows!!

hoisel commented Sep 12, 2012

I'm having the same problem on windows!!

@manuelvanrijn

This comment has been minimized.

Show comment
Hide comment
@manuelvanrijn

manuelvanrijn Sep 13, 2012

Contributor

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

Contributor

manuelvanrijn commented Sep 13, 2012

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

This comment has been minimized.

Show comment
Hide comment
@martinnormark

martinnormark Sep 14, 2012

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.

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

This comment has been minimized.

Show comment
Hide comment
@Anahkiasen

Anahkiasen Sep 14, 2012

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

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

@sapegin

This comment has been minimized.

Show comment
Hide comment
@sapegin

sapegin Sep 14, 2012

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

sapegin commented Sep 14, 2012

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

This comment has been minimized.

Show comment
Hide comment
@petebacondarwin

petebacondarwin Sep 15, 2012

The bottom line is that child_process.spawn doesn't work well on windows. See https://github.com/isaacs/npm-www/commit/98de54b2530e8571fc76a840101d7c897d6e6ba8.
This makes bower unusable on Windows.

The bottom line is that child_process.spawn doesn't work well on windows. See https://github.com/isaacs/npm-www/commit/98de54b2530e8571fc76a840101d7c897d6e6ba8.
This makes bower unusable on Windows.

@Iristyle

This comment has been minimized.

Show comment
Hide comment
@Iristyle

Iristyle Sep 16, 2012

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

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

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

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

@sapegin

This comment has been minimized.

Show comment
Hide comment
@sapegin

sapegin Sep 16, 2012

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

sapegin commented Sep 16, 2012

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

@petebacondarwin

This comment has been minimized.

Show comment
Hide comment
@petebacondarwin

petebacondarwin Sep 16, 2012

Yes, I can get it to work in git bash too but I want to use the built in
command prompt :-)

On 16 September 2012 21:09, Artem Sapegin notifications@github.com wrote:

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


Reply to this email directly or view it on GitHubhttps://github.com/twitter/bower/issues/42#issuecomment-8598442.

Yes, I can get it to work in git bash too but I want to use the built in
command prompt :-)

On 16 September 2012 21:09, Artem Sapegin notifications@github.com wrote:

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


Reply to this email directly or view it on GitHubhttps://github.com/twitter/bower/issues/42#issuecomment-8598442.

@joezimjs

This comment has been minimized.

Show comment
Hide comment
@joezimjs

joezimjs Sep 19, 2012

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.

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

This comment has been minimized.

Show comment
Hide comment
@Iristyle

Iristyle Sep 19, 2012

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

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

This comment has been minimized.

Show comment
Hide comment
@Anahkiasen

Anahkiasen Sep 19, 2012

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

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

This comment has been minimized.

Show comment
Hide comment
@Iristyle

Iristyle Sep 19, 2012

Some more discussion on the download the whole repo thing

#45

Some more discussion on the download the whole repo thing

#45

@sindresorhus

This comment has been minimized.

Show comment
Hide comment
@sindresorhus

sindresorhus Sep 21, 2012

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.

Member

sindresorhus commented Sep 21, 2012

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

This comment has been minimized.

Show comment
Hide comment
@Anahkiasen

Anahkiasen Sep 21, 2012

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.

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

This comment has been minimized.

Show comment
Hide comment
@sindresorhus

sindresorhus Sep 21, 2012

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.

Member

sindresorhus commented Sep 21, 2012

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

This comment has been minimized.

Show comment
Hide comment
@sapegin

sapegin Sep 21, 2012

is still ~70% of computers

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

sapegin commented Sep 21, 2012

is still ~70% of computers

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

@Iristyle

This comment has been minimized.

Show comment
Hide comment
@Iristyle

Iristyle Sep 21, 2012

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.

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

This comment has been minimized.

Show comment
Hide comment
@roryf

roryf Sep 21, 2012

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.

roryf commented Sep 21, 2012

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

This comment has been minimized.

Show comment
Hide comment
@vendethiel

vendethiel Oct 28, 2012

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)

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

This comment has been minimized.

Show comment
Hide comment
@satazor

satazor Oct 28, 2012

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

Member

satazor commented Oct 28, 2012

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

@satazor

This comment has been minimized.

Show comment
Hide comment
@satazor

satazor Oct 28, 2012

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

Member

satazor commented Oct 28, 2012

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

@joezimjs

This comment has been minimized.

Show comment
Hide comment
@joezimjs

joezimjs Oct 28, 2012

How do you solve the Git problem then?

How do you solve the Git problem then?

@satazor

This comment has been minimized.

Show comment
Hide comment
@satazor

satazor Oct 28, 2012

Member

In case of @Nami-Doc he reinstalled mysgit.

Member

satazor commented Oct 28, 2012

In case of @Nami-Doc he reinstalled mysgit.

@joezimjs

This comment has been minimized.

Show comment
Hide comment
@joezimjs

joezimjs Oct 31, 2012

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.

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

This comment has been minimized.

Show comment
Hide comment
@petebacondarwin

petebacondarwin Oct 31, 2012

This is a problem (as I remember) with nodejs trying to do exec to run git

  • exec doesn't work well in the Windows command prompt. Try running bower
    from the git bash shell.
    Pete

On 31 October 2012 15:44, Joe Zim notifications@github.com wrote:

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.


Reply to this email directly or view it on GitHubhttps://github.com/twitter/bower/issues/42#issuecomment-9949658.

This is a problem (as I remember) with nodejs trying to do exec to run git

  • exec doesn't work well in the Windows command prompt. Try running bower
    from the git bash shell.
    Pete

On 31 October 2012 15:44, Joe Zim notifications@github.com wrote:

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.


Reply to this email directly or view it on GitHubhttps://github.com/twitter/bower/issues/42#issuecomment-9949658.

@joezimjs

This comment has been minimized.

Show comment
Hide comment
@joezimjs

joezimjs Nov 1, 2012

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 commented Nov 1, 2012

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

This comment has been minimized.

Show comment
Hide comment
@joezimjs

joezimjs Nov 1, 2012

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.

joezimjs commented Nov 1, 2012

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

This comment has been minimized.

Show comment
Hide comment
@satazor

satazor Nov 2, 2012

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)

Member

satazor commented Nov 2, 2012

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

This comment has been minimized.

Show comment
Hide comment
@joezimjs

joezimjs Nov 2, 2012

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.

joezimjs commented Nov 2, 2012

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

This comment has been minimized.

Show comment
Hide comment
@petebacondarwin

petebacondarwin Nov 2, 2012

It is a problem with nodejs and executing windows processes. Run bower
from a bash shell (i.e. Git Bash) and it will work.
What we really need is a pure nodejs Git client - anyone?
Pete

On 2 November 2012 12:50, Joe Zim notifications@github.com wrote:

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.


Reply to this email directly or view it on GitHubhttps://github.com/twitter/bower/issues/42#issuecomment-10013247.

It is a problem with nodejs and executing windows processes. Run bower
from a bash shell (i.e. Git Bash) and it will work.
What we really need is a pure nodejs Git client - anyone?
Pete

On 2 November 2012 12:50, Joe Zim notifications@github.com wrote:

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.


Reply to this email directly or view it on GitHubhttps://github.com/twitter/bower/issues/42#issuecomment-10013247.

@joezimjs

This comment has been minimized.

Show comment
Hide comment
@joezimjs

joezimjs Nov 2, 2012

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.

joezimjs commented Nov 2, 2012

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

This comment has been minimized.

Show comment
Hide comment
@petebacondarwin

petebacondarwin Nov 2, 2012

I am not saying that you ought to use git bash. I am saying that the
problem is with the interface between nodejs and the windows command
prompt, which you can test by running it under git bash.
You say you have had no problems running processes with nodejs but have you
tried using child_process spawn?
Pete

On 2 November 2012 12:55, Joe Zim notifications@github.com wrote:

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.


Reply to this email directly or view it on GitHubhttps://github.com/twitter/bower/issues/42#issuecomment-10013366.

I am not saying that you ought to use git bash. I am saying that the
problem is with the interface between nodejs and the windows command
prompt, which you can test by running it under git bash.
You say you have had no problems running processes with nodejs but have you
tried using child_process spawn?
Pete

On 2 November 2012 12:55, Joe Zim notifications@github.com wrote:

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.


Reply to this email directly or view it on GitHubhttps://github.com/twitter/bower/issues/42#issuecomment-10013366.

@joezimjs

This comment has been minimized.

Show comment
Hide comment
@joezimjs

joezimjs Nov 3, 2012

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

joezimjs commented Nov 3, 2012

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 comment has been minimized.

Show comment
Hide comment
@bobpaulin

bobpaulin Jul 30, 2013

This fixed the issue for me yeoman/yeoman#593

This fixed the issue for me yeoman/yeoman#593

sheerun added a commit that referenced this issue Jun 10, 2016

Merge pull request #42 from mithun/allow-env-vars
Allow the use of environment variables in .bowerrc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment