【问题标题】:Bower not updating or installingBower 没有更新或安装
【发布时间】:2015-03-31 08:01:24
【问题描述】:

我一直在尝试使用 Bower 更新 moment.js(和其他几个插件),将 moment 从 2.8.4 更新到 2.9。

我将 bower.json 文件更改为 "moment": "2.x"(之前是 ~2.8.3,我也尝试了 ~2.8,然后是 2.x)& bower 说它已缓存和验证,但运行 bower list 显示 2.8.4 是仍然安装。

每当我尝试更新或安装时,它都会检查我的所有依赖项。

然后我卸载了 moment(有效),但现在 bower 不会安装它,bower list 给了 moment not installed

我正在运行最新的 Bower 1.4.0。

我的 bower.json:

{
  "name": "intranet",
  "version": "1.12.35",
  "authors": [
    "SteB"
  ],
  "license": "proprietary",
  "ignore": [
    "**/.*",
    "node_modules",
    "bower_components",
    "test",
    "tests"
  ],
  "dependencies": {
    "jquery": "~2.1",
    "jquery-migrate": "~1.2",
    "modernizr": "~2.8.3",
    "moment": "2.x",
    "respond": "~1.4.2",
    "jquery-ui": "~1.11",
    "chartjs": "~1.0.2",
    "rickshaw": "~1.5.1",
    "gmaps": "~0.4.14",
    "d3": "~3.4.11",
    "bootstrap-modal": "~2.2.5",
    "kbwood_countdown": "~2.0.1",
    "bootstrap": "2.3.2",
    "footable": "2.0.1.5",
    "bootstrap-maxlength": "~1.5.7",
    "flot": "~0.8.3",
    "jqplot": "*",
    "scrollup": "2.4.*",
    "fullcalendar": "1.6.4",
    "bootstrap-switch": "~2.0.5",
    "es5-shim": "~4.1",
    "chosen": "~1.2",
    "platform": "~1.3",
    "fontawesome": "~4.2.0",
    "jquery.steps": "~1.1",
    "jquery-cookie": "~1.4",
    "typeahead.js": "~0.10.5",
    "ladda": "~0.9.7"
  },
  "devDependencies": {},
  "resolutions": {
    "bootstrap": "2.3.2",
    "jquery": "~2.1"
  }
}

【问题讨论】:

  • 你可以像这样安装任何特定版本:'bower install moment#2.9' ...如果你想更新整个 bower.json npmjs.com/package/bower-update,你应该试试这个
  • @nitin - 它遍历每个插件,说它已经过验证和缓存时刻 v2.9.0,但文件没有出现,并且凉亭列表仍然显示 not installed
  • 粘贴你的 bower.json 文件

标签: bower


【解决方案1】:
  1. 删除之前的“bower_components”文件夹或“.bowerrc”中指定的任何其他目标安装位置
  2. 使用下面的 bower.json(null 获取最新版本)
  3. 运行“凉亭安装”

    {
     "name": "intranet",
      "version": "1.12.35",
      "authors": [
                  "SteB"
                 ],
      "ignore": [
                 "**/.*",
                 "node_modules",
                 "bower_components",
                 "test",
                 "tests"
                ],
       "license": "proprietary",
       "dependencies" : {
                         "jquery": null,
                         "jquery-migrate": null,
                         "modernizr": null,
                         "moment": null,
                         "respond": null,
                         "jquery-ui": null
                       }
     }
    

上面会很好。您需要检查对 bower bcz 的其余依赖项,那里的命名似乎不正确

【讨论】:

  • 使用你的示例 bower.json 我基本上重新安装了所有东西,我认为问题是 jquery/bootstrap 的分辨率版本(我分别在 2.1.3 和 2.3.2 上)
猜你喜欢
  • 1970-01-01
  • 2015-10-16
  • 1970-01-01
  • 1970-01-01
  • 2015-09-02
  • 1970-01-01
  • 2014-11-26
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多