How can I invoke npm on heroku command line (to install bower components)?

后端 未结 4 2137
清酒与你
清酒与你 2020-12-13 04:33

Bower is for client side Javascript what npm is for the server side and reads a component.json file to recognize dependencies that should be fetched at deploy t

相关标签:
4条回答
  • 2020-12-13 05:18

    You can also setup a postintall command, something like this in your package.json

    "dependencies": {
        "bower": "0.6.x"
    },
    "scripts": {
        "postinstall": "./node_modules/bower/bin/bower install"
    }
    

    Then npm install will also install bower dependencies.

    Pros : one command to rule them all.

    Cons : you unnecessarily embed bower as a dependency.

    0 讨论(0)
  • 2020-12-13 05:20

    You can use run like this:

    heroku run npm install git://github.com/webjay/kaiseki
    
    0 讨论(0)
  • 2020-12-13 05:31

    You can use bower directly like this

    "dependencies": {
        "bower": "^1.7.9"
    },
    "scripts": {
        "postinstall": "sudo bower install --allow-root "
    }
    
    0 讨论(0)
  • 2020-12-13 05:34

    You should declare NPM dependencies in the package.json file

    All you install from shell will be deleted on exit shell. You are in a cloned instance.

    0 讨论(0)
提交回复
热议问题