我們使用Nexus作爲我們的NPM軟件包存儲庫(等等)。 在我們的package.json文件中,我們使用semver語法https://docs.npmjs.com/misc/semver 但它被忽略。有誰知道我們是否有配置問題?或者這可能不是NPM對Nexus的期望?一個場景的Nexus Sonatype NPM回購不支持semver版本
的例子,可以在開發過程中發生在我們身上:
成分A - 的package.json:
"name": "ComponentA",
"version": "1.1.2"
B組分 - 的package.json:
"name": "ComponentB",
"version": "3.0.0"
"dependencies":
"ComponentA": "^1.1.0"
Person1構建&將ComponentA的版本1.1.2發佈到nexus。
a。 ComponentA npm run build b。 ComponentA npm發佈到nexus c。 npm view ComponentA latest:1.1.2
現在,Person2構建了7個發佈ComponentA的版本1.1.1。
a。 ComponentA npm run build b。 ComponentA npm發佈到nexus c。 npm視圖ComponentA latest:1.1.1儘管知道1.1.2已經發布,但Nexus將組件的最新版本視爲最近發佈的版本。
現在,當ComponentB安裝它的依賴關係時,我期望獲得ComponentA的1.1.2版本,但實際上我得到的是版本1.1.1的。 d)。 ComponentB npm install