Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bower crashes for no reason from a bash script #826

Closed
binarykitchen opened this issue Aug 28, 2013 · 8 comments
Closed

Bower crashes for no reason from a bash script #826

binarykitchen opened this issue Aug 28, 2013 · 8 comments
Labels

Comments

@binarykitchen
Copy link

Hi there

In one of my git hooks I run an external bash script. And in that script we have bower install between the lines. Each time it crashes with the error below. When I run bower install manually, it works.

The crash is weird and does not say what's wrong. Hope you guys can fix this?

Thanks!
M

/opt/node-0.10.16/lib/node_modules/bower/node_modules/tmp/lib/tmp.js:261

  throw err;









^


TypeError: Arguments to path.join must be strings
    at path.js:360:15
    at Array.filter (native)
    at Object.exports.join (path.js:358:36)
    at rc (/opt/node-0.10.16/lib/node_modules/bower/node_modules/bower-config/lib/util/rc.js:28:19)
    at Config.load (/opt/node-0.10.16/lib/node_modules/bower/node_modules/bower-config/lib/Config.js:12:20)
    at Function.Config.read (/opt/node-0.10.16/lib/node_modules/bower/node_modules/bower-config/lib/Config.js:47:19)
    at Object.<anonymous> (/opt/node-0.10.16/lib/node_modules/bower/lib/config.js:3:38)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)

Deploy script ended on Wed Aug 28 2013 16:23:43 GMT+1200 (NZST) with exit code 7
@satazor
Copy link
Member

satazor commented Aug 28, 2013

It's crashing on https://github.com/bower/config/blob/master/lib/util/rc.js#L28 because apparently no HOME folder is set (via env variables). Anyway, it should not crash in that case anyway so I will protect that.

@satazor
Copy link
Member

satazor commented Aug 28, 2013

Fixed in https://github.com/bower/config/commit/6abd4e5f9b3f8f7f1722e0bc361c63bfe8667f87. Can you please uninstall bower and install it again with npm uninstall -g -f bower && npm install -g bower and report back?

@wibblymat
Copy link
Member

We seem to have a few problems with assuming that HOME is set. Maybe we
should check at startup that it is set and that the path exists, just like
we check for git?
On 28 Aug 2013 08:23, "André Cruz" notifications@github.com wrote:

Fixed in bower/config@6abd4e5https://github.com/bower/config/commit/6abd4e5f9b3f8f7f1722e0bc361c63bfe8667f87.
Can you please uninstall bower and install it again with npm uninstall -g
-f bower && npm install -g bower and report back?


Reply to this email directly or view it on GitHubhttps://github.com//issues/826#issuecomment-23395780
.

@satazor
Copy link
Member

satazor commented Aug 28, 2013

@wibblymat we could do that, but we should not error out because even without HOME bower should work.

@wibblymat
Copy link
Member

I was thinking that we would issue a warning to say that we couldn't
determine a HOME so we can't use your cache or bowerrc, something like
that. Stops users being surprised when things don't work the same as when
they just run it manually.
On 28 Aug 2013 08:38, "André Cruz" notifications@github.com wrote:

@wibblymat https://github.com/wibblymat we could do that, but we should
not error out because even without HOME bower should work.


Reply to this email directly or view it on GitHubhttps://github.com//issues/826#issuecomment-23396459
.

@satazor
Copy link
Member

satazor commented Aug 28, 2013

Yes I like that.

@binarykitchen
Copy link
Author

You mentioned a missing HOME. So I fixed one line in that upstart service to this:

exec sudo -H -u <username> node <path to git hook server>

The -H forces to set a HOME directory and then Bower worked like a charm when deploying releases. I did not try @satazor's commit yet. Happy with the -H fix. But yes, a warning would be good.

@satazor
Copy link
Member

satazor commented Aug 28, 2013

Alright I will create a new issue for this.

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

No branches or pull requests

3 participants