Sh: 1: bower: could not be found error when deploying to herokuapp

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" } } 

When deploying to herokuapp, the error message sh: 1: bower: not found appears (I tried about 10 times). I tried to change postinstall to bower cache clean && bower install , according to https://github.com/auth0/auth0.js/issues/12 , but to no avail. I also tried npm uninstall -g bower and reinstalled the conversation, but still no luck.

+5
source share
2 answers

I found out what happened! I did not have add and commit package.json after making changes to include the conversation as one of the dependencies.

-2
source

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

 "dependencies": { "bower": "^1.5.2" } 
+18
source

Source: https://habr.com/ru/post/1233934/


All Articles