Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sh: 1: bower: not found error while deploying to herokuapp [closed]

Current package.json file:

    {
      "name": "ff-album",
      "version": "1.0.0",
      "description": "",
      "main": "index.js",
      "engines": {
        "node": "0.12.7",
        "npm": "2.11.3"
      },
      "scripts": {
        "postinstall": "node ./node_modules/bower/bin/bower install"
      },
      "author": "",
      "license": "CC",
      "dependencies": {
        "express": "4.13.1",
        "http-server": "^0.8.4",
        "bower": "^1.5.2"
      },
      "devDependencies": {
        "bower": "^1.5.2"
      }
    }

Current bower.json:

    {
      "name": "ff-album",
      "version": "0.0.0",
      "author": [
        "Francesco Fibonacci"
      ],
      "license": "CC",
      "ignore": [
        "**/.*",
        "node_modules",
        "bower_components",
        "app/vendor",
        "test",
        "tests"
      ],
      "resolutions": {
        "bootstrap": "~3.3.1",
        "angular": ">= 1.0.8",
        "angular-bootstrap": "~0.12.0"
      },
      "dependencies": {
        "angular": "~1.4.6",
        "angular-bootstrap": "~0.13.4",
        "angular-ui-router": "~0.2.15",
        "bootstrap": "~3.3.5",
        "jasny-bootstrap": "~3.1.3",
        "lodash": "~3.10.1",
        "moment": "~2.10.6",
        "swagger-client-generator": "~0.2.13",
        "swagger-js": "~2.1.5"
      }
    }

While deploying to herokuapp, the error message sh: 1: bower: not found keeps showing up (I have tried about 10 times). I have tried changing postinstall to bower cache clean && bower install, as per https://github.com/auth0/auth0.js/issues/12 but to no avail. I have also tried npm uninstall -g bower and reinstalled bower, but still no luck.

like image 745
taylorswiftfan Avatar asked Oct 17 '15 19:10

taylorswiftfan


1 Answers

You need to add bower as dependency, not only in the devDependencies but in:

"dependencies": {
  "bower": "^1.5.2"
}
like image 173
Jorge Mario Valencia Herrera Avatar answered Oct 06 '22 01:10

Jorge Mario Valencia Herrera