Deployment of my Node.js MEAN app to heroku fails with the following errors. I can\'t figure out what is wrong with the bower install...
Here is the error message:
This is likely related to this issue with bower, the cause of which is currently still being investigated:
https://github.com/bower/bower/issues/933
I've also been having some similar issues with the bower install
command failing on heroku. Here's what worked for me:
1. Temporarily remove node_modules
and bower_components
from .gitignore
.
ENOENT
error when trying to install Angular using bower through a postinstall script in heroku..bowerrc
file, then make sure that directory is not present in your .gitignore
.2. Edit (or create) .bowerrc
and tell it to use temp directories that are local to the project directory:
{ "storage": { "packages": ".bower-cache", "registry": ".bower-registry" }, "tmp": ".bower-tmp" }
/app
, which was resulting in ENOTEMPTY
errors (maybe because it was trying to clear those directories, but it didn't have access because they are shared with other users? Just throwing out a guess...)Hope this helps someone else.
Note: Even after performing the above steps, the bower install
command may still occasionally fail. However, it generally works the second or third time - just try running the command again... Until the underlying issue is resolved, that's the best advice that I can offer.