Use ‘bower install’ on Heroku · Thorsten Hans’ blog

Spread the love


bower.io is a fantastic tool for managing client-side dependencies. When you’re deploying a Node.js app to Heroku, you’ve to add script to your package.json file instead to get bower running right after installing your app using git.

First, you’ve to ensure that bower is part of your dependencies. Either double-check the dependencies object within your package.json or execute

Somewhere in your package.json you’ll find another object called scripts add a dedicated script for postinstall like shown in the following snippet:

{
  "scripts": {
    "postinstall": "./node_modules/bower/bin/bower install"
  }
}

postinstall will be executed right after you’ve pushed a new release to Heroku and right before the start script is responsible for spinning up your Node.js app.


Share this content:

I am a passionate blogger with extensive experience in web design. As a seasoned YouTube SEO expert, I have helped numerous creators optimize their content for maximum visibility.

Leave a Comment