使用Bower更新到最新的Polymer

时间:2022-06-17 07:26:41

I have a Polymer application which is configured as following:

我有一个Polymer应用程序,配置如下:

My main project bower.json file:

我的主要项目bower.json文件:

{
  "name": "Raf",
  "authors": [
    "Raffaeu <raffaeu@gmail.com>"
  ],
  "description": "Test Project",
  "dependencies": {
    "polymer": "Polymer/polymer#1.2.0",
    "iron-elements": "PolymerElements/iron-elements#^1.0.8",
    "paper-elements": "PolymerElements/paper-elements#^1.0.7"
  }
}

and inside my bower_components folder I do have a polymer folder with the following JSON:

在我的bower_components文件夹中,我有一个带有以下JSON的聚合物文件夹:

{
  "name": "polymer",
  "version": "1.2.0",
  "main": [
    "polymer.html"
  ],
  "repository": {
    "type": "git",
    "url": "https://github.com/Polymer/polymer.git"
  },
  "dependencies": {
    "webcomponentsjs": "^0.7.2"
  }
}

Now, if I am in the root folder (where the main bower.json file is located) and I am running bower info polymer bower returns me the following list of versions:

现在,如果我在根文件夹(主bower.json文件所在的位置)并且我正在运行bower info聚合物bower返回以下版本列表:

bower cached        https://github.com/Polymer/polymer.git#1.6.0
bower validate      1.6.0 against https://github.com/Polymer/polymer.git#*

{
  name: 'polymer',
  version: '1.6.0',
   ...

But if I run bower update polymer --save console returns following message and doesn't update to 1.6.0 but it stays to my current version which is 1.2.0: Unable to find a suitable version for polymer, please choose one by typing one of the numbers below:

但是,如果我运行bower更新聚合物--save控制台返回以下消息并且不更新到1.6.0但它保持到我当前版本1.2.0:无法找到合适的聚合物版本,请通过键入选择一个以下数字之一:

    1) polymer#1.2.0 which resolved to 1.2.0 and is required by MyTestProject
    2) polymer#~1.2.0 which resolved to 1.2.4 and is required by paper-datatable#0.9.8
    3) polymer#^1.2.0 which resolved to 1.6.0 and is required by iron-behaviors#1.0.13
    4) polymer#^1.2.1 which resolved to 1.6.0 and is required by paper-behaviors#1.0.11
    5) polymer#^1.2.4 which resolved to 1.6.0 and is required by iron-menu-behavior#1.1.3
    6) polymer#^1.1.1 which resolved to 1.6.0 and is required by vaadin-grid#1.0.0
    7) polymer#^1.0.0 which resolved to 1.6.0 and is required by iron-a11y-keys-behavior#1.1.1
    8) polymer#^1.1.0 which resolved to 1.6.0 and is required by paper-dropdown-menu#1.1.3

Prefix the choice with ! to persist it to bower.json

? Answer 1

And nothing is updated. Should I manually change version to 1.6.0 inside the polymer folder then run update?

没有任何更新。我应该在聚合物文件夹内手动将版本更改为1.6.0然后运行更新?

1 个解决方案

#1


1  

you need to select !3 this will add a new object in your bower.json called resolutions with value as polymer#^1.2.0. Using ! will persist your choice in bower.json. As you are selecting first option it is taking the version from your bower.json which is set to use exact version i.e. 1.2.0.

你需要选择!3这将在你的bower.json中添加一个新对象,称为分辨率,其值为聚合物#^ 1.2.0。用!将坚持你的选择bower.json。当您选择第一个选项时,它将从您的bower.json中获取该版本,该版本设置为使用精确版本,即1.2.0。

Actually, you can select anything after 3rd option as they all are latest above mentioned version because of '^'.

实际上,您可以在第3个选项之后选择任何内容,因为它们都是最新的上述版本,因为'^'。

#1


1  

you need to select !3 this will add a new object in your bower.json called resolutions with value as polymer#^1.2.0. Using ! will persist your choice in bower.json. As you are selecting first option it is taking the version from your bower.json which is set to use exact version i.e. 1.2.0.

你需要选择!3这将在你的bower.json中添加一个新对象,称为分辨率,其值为聚合物#^ 1.2.0。用!将坚持你的选择bower.json。当您选择第一个选项时,它将从您的bower.json中获取该版本,该版本设置为使用精确版本,即1.2.0。

Actually, you can select anything after 3rd option as they all are latest above mentioned version because of '^'.

实际上,您可以在第3个选项之后选择任何内容,因为它们都是最新的上述版本,因为'^'。