In my project I've installed bower
components without save option. Now, I would like update to bower.json
?
How can I update bower.json with installed packages?
You can find the latest version of the npm added in package. json file. If you want to add the latest version either you can run npm install or npm install @latest .
To add a new Bower package to your project you use the install command. This should be passed the name of the package you wish to install. As well as using the package name, you can also install a package by specifying one of the following: A Git endpoint such as git://github.com/components/jquery.git.
Just list your dependencies:
bower list
Then you should run all install command with param '--save' like this:
bower install bootstrap --save
It's a hard work, but if you have a thousand dependencies, could you create a script to automatize the task.
before doing anything rename your bower.json in bower2.json for example.
then you can do a:
$ bower init
(automatically create a bower.json file).
note that all questions should be pre-filled with your current config.
When it will ask you:
set currently installed components as dependencies? say yes,
You now have all your dependencies in the new bower.json file (and you can check if everything is right with the old bower2.json)
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