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.
For npm install specific version, use npm install [package-name]@[version-number]. Use npm view [package-name] version to know the specific latest version of a package available on the npm registry. Use npm list [package-name] to know the specific latest version of an installed package.
You can also create a bower. json file and define multiple packages name with or without version. Navigate to your project folder directory and run the command “bower install”. It will download and install all the packages in your bower_components folder.
Bower depends on Node. js and npm. Also make sure that git is installed as some bower packages require it to be fetched and installed.
By default, npm install will install all modules listed as dependencies in package.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With