myTerminal myTerminal - 4 months ago 19
Node.js Question

Not able to run bower on Travis CI

I have almost tried every possible thing here, but am not able to run builds on Travis CI as it errors out on bower.

I know this question might sound like a duplicate, but I have tried the usual fix that seems to be working for everyone else, but not for me :)

An example: http://stackoverflow.com/a/29064091/1749585

My repository is https://github.com/myTerminal/faded-multiselect and you can find it on Travis CI at https://travis-ci.org/myTerminal/faded-multiselect

Answer

You can try installing bower in before_install rather than before_script. Your .travis.yml would look like:

language: node_js
node_js:
  - "0.11"
before_install:
  - npm install -g grunt-cli bower
  - bower install
sudo: required

The way Node.js applications are built on Travis CI is that is executes before_script after install (which does npm install), before_script is something that is executed after the install step.

You need bower during your npm install, hence your build fails.