2017-02-04 66 views
1
分辨率

這是爲什麼問我下決心當一切都寄託^主要版本?我想我在做GitHub上我的版本有點問題,因爲它只要求對我的回購協議的決議,而不是爲了聚合物是兩種不同的次要版本。鮑爾 - 鋼釘到主要版本問叫

我對這個bower.json運行bower install

{ 
    "name": "test1", 
    "homepage": "https://github.com/tylergraf/test1", 
    "version": "0.0.2", 
    "dependencies": { 
    "test2": "git+https://github.com/tylergraf/test2#^0.0.3", 
    "test3": "git+https://github.com/tylergraf/test3#^0.0.5" 
    }  
} 

test2的bower.json看起來是這樣的:

{ 
    "name": "test2", 
    "homepage": "https://github.com/tylergraf/test2", 
    "version": "0.0.3", 
    "dependencies": { 
    "test3": "git+https://github.com/tylergraf/test3#^0.0.3", 
    "polymer": "git+https://github.com/polymer/polymer#^1.7.0" 
    } 
} 

TEST3 bower.json看起來是這樣的:

{ 
    "name": "test3", 
    "homepage": "https://github.com/tylergraf/test3", 
    "version": "0.0.5", 
    "dependencies": { 
    "test2": "git+https://github.com/tylergraf/test2#^0.0.2", 
    "polymer": "git+https://github.com/polymer/polymer#^1.4.0" 
    } 
} 

這裏是我的輸出:

Unable to find a suitable version for test2, please choose one by typing one of the numbers below: 
    1) test2#^0.0.2 which resolved to 0.0.2 and is required by test3#0.0.3, test3#0.0.5 
    2) test2#^0.0.3 which resolved to 0.0.3 and is required by test1 

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

? Answer 2 

Unable to find a suitable version for test3, please choose one by typing one of the numbers below: 
    1) test3#^0.0.3 which resolved to 0.0.3 and is required by test2#0.0.3 
    2) test3#^0.0.5 which resolved to 0.0.5 and is required by test1 

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

? Answer 2 

回答

2

我挖成閨房,然後得到了semver。

主要零是在semver規範中的一個特殊的情況下,任何低於0.1.0總是恰好解決本身。

^0.0.1總是指向0.0.1

這裏有一個node.js article

CARET:MAJOR ZERO鑑於各地自由 使用的主要版本0 Node.js的社會規範, 波浪和尖之間的第二顯著差異一直比較有爭議的:路它處理 版本低於1.0.0。雖然波浪低於 1.0.0相同的行爲,因爲它上面做,插入符把爲0的主版本作爲一種特殊情況。脫字符擴展到兩個不同的範圍,具體取決於是否 也有0次版本與否,我們將在下面看到:主要及 MINOR ZERO:^ 0.0.Z→0.0.Z使用插入符,對於低於版本 0.1.0根本沒有提供靈活性。只有指定的確切版本纔有效。例如,^ 0.0.3只會只允許正好 0.0.3版本。

special-case for 0.x in^is very counter-inutitive and rage-inducing