I had the same issue and (somehow) I solved it without committing the bower_components
folder. Since Bower reached 1.0, it is possible to consume the API programatically rather than going through the command line interface. Hence, you can create a small script as below:
var bower = require('bower'),
path = require('path');
bower.commands
.install([path.resolve(".")])
.on('end', function (installed) {
console.log(installed);
});
On Nodejitsu it is possible to trigger commands pre and post deployment using the script
field in your package.json
. Thus, I can trigger my bower install on postdeployment with:
{
"name": "myapp",
"version": "0.0.1",
"description": "",
"main": "app.js",
"scripts" : {
"predeploy": "echo This will be run before deploying the app",
"postdeploy": "node bower_install.js",
"start": "node app.js"
},
"dependencies": {
...
}
}
Where bower_install.js
is the script above.