Bower 未更新或安装

Bower not updating or installing

我一直在尝试使用 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"
  }
}
  1. 删除以前的 "bower_components" 文件夹或“.bowerrc”中指定的任何其他目标安装位置
  2. 在下面使用 bower.json(为空以获得最新版本)
  3. 运行 "bower install"

    {
     "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 的其余依赖性,那里的命名似乎不正确