【问题标题】:bower does not install dependenciesbower 不安装依赖项
【发布时间】:2014-01-25 08:42:53
【问题描述】:

我有以下 bower.json

{
  "name": "name of app",
  "version": "0.0.0",
  "homepage": "",
  "license": "MIT",
  "directory": "public/bower_components",
  "ignore": [
    "**/.*",
    "node_modules",
    "bower_components",
  ],
  "dependencies": {
    "less": "~1.6.1",
    "bootstrap": "~3.0.3",
    "angular": "~1.2.8",
    "angular-animate": "~1.2.8",
    "angular-route": "~1.2.8"
  }
}

但是当我运行bower install 时,它不会在公共目录下创建bower_components 并且它不会安装依赖项。下面是bower install 命令的屏幕截图。

我该如何解决这个问题?

【问题讨论】:

    标签: javascript build frontend bower


    【解决方案1】:

    来自文档

    A custom install location can be set in a .bowerrc file using the directory property. The .bowerrc file should be a sibling of your project's bower.json.

    自定义目录路径需要在.bowerrc文件中设置,而不是bower.json

    【讨论】:

      【解决方案2】:

      你在这一行多了一个逗号:

      "bower_components",
      

      删除逗号,它应该可以工作。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2015-03-26
        • 1970-01-01
        • 2016-01-13
        • 2015-03-03
        • 1970-01-01
        • 2013-10-21
        相关资源
        最近更新 更多