2014-04-09 70 views
0

我寫了一個庫,我想在另一個項目中使用。然而,當我添加庫依賴於項目中,我得到以下錯誤運行composer update -vvv後:作曲家依賴問題與外部存儲庫

Your requirements could not be resolved to an installable set of packages. 

Problem 1 
    - Installation request for my/library dev-master -> satisfiable by my/library[dev-master]. 
    - my/library dev-master requires doctrine/migrations dev-master -> no matching package found. 

Potential causes: 
- A typo in the package name 
- The package is not available in a stable-enough version according to your minimum-stability setting 
    see <https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion> for more details. 

此錯誤是非常令人困惑我,因爲我的項目有我的圖書館,因爲它是唯一的依賴,也就是我的項目composer.json長相像這樣:

{ 
    "name": "my/project", 
    "type": "project", 
    "description": "My project", 
    "autoload": { 
     "psr-0": { "MyNamespace\\": ["src/", "tests/src/"] } 
    }, 
    "repositories": [ { 
     "type": "vcs", 
     "url": "[email protected]:my/library" 
    } ], 
    "require": { 
     "php": ">=5.5", 
     "my/library": "dev-master" 
    }, 
    "require-dev": { 
     "phpunit/phpunit": "3.*" 
    } 
} 

正如你所看到的,非常簡單。我的圖書館的版本要求dev-master的原因是因爲master是目前我工作的唯一分支(我一個人工作,目前不需要其他分支機構)。

到目前爲止,解決此問題的唯一方法是將我的庫composer.json的依賴關係添加到我的項目的composer.json,這似乎是不必要的步驟。

如何解決此依賴性問題?

+0

您可以發佈其他錯誤消息嗎?通常有一個跡象表明哪個依賴失敗。此外,[作曲家手冊的這一部分](https://getcomposer.org/doc/articles/troubleshooting.md)可能會有所幫助。 – vascowhite

回答

2

它看起來好像它是一個穩定性問題。以下兩行添加到您的composer.json: -

"minimum-stability": "dev", 
"prefer-stable": true, 

參考: - minimum-stability & prefer-stable

希望這將解決你的問題。