Node.js Heroku Deployment - Fails To Exec Postinstall Script To Install Bower

后端 未结 5 827
暗喜
暗喜 2021-01-31 22:47

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:

5条回答
  •  不思量自难忘°
    2021-01-31 23:25

    @ac360 This isn't an issue with bower at all. It's generally a warning you can get if different libraries use the same dependency however a different version. You should never add your public/lib to the repo. That defeats the purpose of what bower can be used for. Keep your repo as light as possible, and let dependencies download and resolve at build time so you can get the latest and greatest within the parameters defined in your bower.json

    To resolve this issue completely for auto-deploys, bower gives us a property on the bower.json called resolutions

    Simply create the following in your bower.json

    "resolutions": {
      "ember": "1.2.10"
    }
    

    The reason you still had problems even if you had resolutions defined was because the version you picked wasn't going to satisfy all dependencies so the question came up during the heroku install.

    Alternatively, you can build locally, and when you are asked which version to choose from, if you preceed the number choice with the bang ! symbol, bower will update your bower.json for you!

    See: https://github.com/bower/bower/issues/532

提交回复
热议问题