How to install bower dependencies using npm install?

11,623

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

Share:
11,623
Programmer
Author by

Programmer

Updated on June 13, 2022

Comments

  • Programmer
    Programmer almost 2 years

    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.