Programmer
Programmer

Reputation: 437

How to install bower dependencies using npm install?

I want npm install to install the bower dependencies as well. I have a bower.json file containing frontend packages and there is package.json file which contains the backend packages. After i run npm install, node_modules are installed whereas the dependencies mentioned in bower.json file are not installed.

I don't want to use bower install rather I want to do all this with npm install command.

Upvotes: 6

Views: 15804

Answers (1)

Michal Moravcik
Michal Moravcik

Reputation: 2329

It's quite simple. If you have bower listed in package.json as dependency you may add postinstall script to your package.json as follows:

"scripts": {
  "postinstall": "bower install"
}

and running npm install will launch also bower install automatically

Upvotes: 9

Related Questions