3

How to update bower.json with installed packages from bower_components?

bower init does not add all my installed packages into bower.json, some are obviously missing

bower list fails connecting to github on one package.

So whats the correct way of doing this?

davegson
  • 8,205
  • 4
  • 51
  • 71
Shlomo
  • 3,880
  • 8
  • 50
  • 82
  • Check this if help: http://stackoverflow.com/questions/17865487/bower-automatically-update-bower-json and this http://stackoverflow.com/questions/20279792/how-to-update-bower-json-with-installed-packages – ptCoder Apr 28 '15 at 10:02
  • Using `--save` installs the package and adds it to the file. But you cannot except people to run the installs again for every package... Using `bower list` as I wrote... – Shlomo Apr 28 '15 at 10:38
  • Yes, this has been answered here - http://stackoverflow.com/a/26585444/228369 – chrismarx Mar 08 '16 at 01:13

1 Answers1

1

Install all your new dependencies with --save tag. This will add them to your bower.json file automatically.

# e.g. bower install angular --save
bower install <package> --save

If you missed adding save tag you can just run bower init and it will generate a new bower.json using dependencies from existing bower_components folder.

bower init
tk421
  • 5,775
  • 6
  • 23
  • 34
nitin
  • 3,747
  • 2
  • 24
  • 31