如何使用 bower_components 中已安装的软件包更新 bower.json
Posted
技术标签:
【中文标题】如何使用 bower_components 中已安装的软件包更新 bower.json【英文标题】:How to update bower.json with installed packages from bower_components 【发布时间】:2015-07-07 02:01:23 【问题描述】:如何使用来自bower_components
的已安装软件包更新bower.json
?
bower init
没有将我安装的所有包都添加到bower.json
,有些明显丢失了
bower list
在一个包上连接到 github 失败。
那么正确的做法是什么?
【问题讨论】:
如果有帮助,请检查此:***.com/questions/17865487/… 和此***.com/questions/20279792/… 使用--save
安装包并将其添加到文件中。但是你不能除了人们为每个包再次运行安装......就像我写的那样使用bower list
......
是的,这里已经回答了这个问题 - ***.com/a/26585444/228369
【参考方案1】:
使用--save
标签安装所有新依赖项。这会将它们添加到
您的bower.json
文件会自动生成。
# e.g. bower install angular --save
bower install <package> --save
如果您错过了添加 save
标签,您可以运行 bower init,它会使用现有 bower_components 文件夹中的依赖项生成新的 bower.json
。
bower init
【讨论】:
问题是,事后怎么办 @chrismarx 我认为对这个答案的第二次编辑解决了这个问题吗?以上是关于如何使用 bower_components 中已安装的软件包更新 bower.json的主要内容,如果未能解决你的问题,请参考以下文章
如何使用 Angular 和 Jasmine 模拟 socket.io
AWS Elastic Beanstalk:我是不是必须使用完整的“/node_modules”和“/bower_components”部署我的应用程序并编译 sass 和其他依赖项?