Sunday, 15 September 2013

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



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

bower client side javascript npm server side , reads component.json file recognize dependencies should fetched @ deploy time i'd happy heroku run @ slug compilation time.

unfortunately can not invoke npm or bower heroku console or one-off command (heroku run "npm help") (heroku run bash -> npm help) it's possible ruby's rake. i've set npm , node (latest/x versions) in package.json in engines section, not dependencies.

i think solved customizing node buildpack consider little heavy task activating obvious.

you can setup postintall command, in package.json

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

then npm install install bower dependencies.

pros : 1 command rule them all.

cons : unnecessarily embed bower dependency.

node.js heroku bower

No comments:

Post a Comment