Rodrigo Reis
Rodrigo Reis

Reputation: 1941

How to run Bower on Heroku

I'm trying to deploy a NodeJs App on Heroku and this app uses bower. I did what have been suggested here, but I'm having this error on Heroku after a push:

bower error status code of git: 128

Upvotes: 5

Views: 1788

Answers (3)

user6426085
user6426085

Reputation:

Well, doing that may not fix this problem, but you can use

git config --global url."https://".insteadOf git://

to tell git to use HTTPS instead of GIT which worked out for me to install npm dependencies.

Upvotes: 2

gevorg
gevorg

Reputation: 5055

Here is what I use in my app:

Adding proper scripts to package.json

"scripts": {
  "start": "node web.js",
  "postinstall": "bower cache clean && bower install"
},

Add bower to dependency list

"dependencies": {
  ...
  "bower": "~1.3.12",
   ...
},

Publishing flow for Heroku is following

  1. It pulls recent version
  2. Runs install
  3. Runs postinstall
  4. Runs start

My Sample

Upvotes: 6

Aurélien Thieriot
Aurélien Thieriot

Reputation: 5923

Apparently people have cleaned their cache?

https://github.com/bower/bower/issues/50

You can run arbitrary commands on your heroku host by using:

heroku run console

Upvotes: 1

Related Questions