2015-02-09 260 views
0

我使用Toran作爲packagist代理並作爲我的主要私人存儲庫列表。我添加了一個專用組件,託管在bitbucket上。以下是組件的composer.json作曲家無法找到可滿足的軟件包版本

{ 
    "name": "naroga/metronic-bundle", 
    "authors": [ 
     { 
      "name": "Pedro Cordeiro", 
      "email": "<my email>" 
     } 
    ], 
    "require": {}, 
    "autoload": { 
     "psr-0" : { 
      "Naroga\\MetronicBundle" : "src" 
     } 
    } 
} 

我還沒有標記在這個naroga/metronic-bundle組件單個提交,因爲它仍然在開發階段非常早。後來我也需要它,使用下面的composer.json,在不同的項目:

{ 
    "repositories": [ 
     {"type": "composer", "url": "http://<my toran host>/repo/private/"}, 
     {"type": "composer", "url": "http://<my toran host>/repo/packagist/"}, 
     {"packagist": false} 
    ], 
    "name": "naroga/sample-project", 
    "type": "project", 
    "autoload": { 
     "psr-0": { "": "src/", "SymfonyStandard": "app/" } 
    }, 
    "require": { 
     ... 
     "naroga/metronic-bundle": "dev-master" 
    }, 
} 

我不想降低最低穩定性,對我要求應保持穩定許多其他組件。

當我跑在我的項目一個簡單的composer update -vvv,作曲家正確下載我的項目的composer.json,如下所述:

Downloading http://<my toran host>/repo/packagist/p/naroga/metronic-bundle.json 

可是,到了最後,它總是拋出這個錯誤:

Problem 1 
- The requested package naroga/metronic-bundle could not be found in any version, there may be a typo in the package name. 

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. 

Read <http://getcomposer.org/doc/articles/troubleshooting.md> for further common problems. 

我不想添加任何標籤,也不想降低項目的minimum-stability。我如何繼續安裝此軟件包?


composer show naroga/metronic-bundle -vvv顯示下面的輸出:

所有的
C:\Apache24\htdocs\naroga>composer show naroga/metronic-bundle -vvv 
Reading ./composer.json 
Loading config file C:/Users/pedro.cordeiro/AppData/Roaming/Composer/auth.json 
Loading config file ./composer.json 
Executing command (CWD): git describe --exact-match --tags 
Executing command (CWD): git branch --no-color --no-abbrev -v 
Executing command (CWD): git rev-list master..outer-blog-view 
Failed to initialize global composer: Composer could not find the config file: C:/Users/pedro.cordeiro/AppData/Roaming/Composer/composer.json 
To initialize a project, please create a composer.json file as described in the http://getcomposer.org/ "Getting Started" section 
Downloading http://<my toran host>/repo/private/packages.json 
Writing C:/Users/pedro.cordeiro/AppData/Local/Composer/repo/http---<my toran host>-repo-private/packages.json into cache 
Downloading http://<my toran host>/repo/packagist/packages.json 
Writing C:/Users/pedro.cordeiro/AppData/Local/Composer/repo/http---<my toran host>-repo-packagist/packages.json into cache 
Downloading http://<my toran host>/repo/private/p/naroga/metronic-bundle.json 
Writing C:/Users/pedro.cordeiro/AppData/Local/Composer/repo/http---<my toran host>-repo-private/provider-naroga$metronic-bundle.json into cache 
Downloading http://<my toran host>/repo/packagist/p/naroga/metronic-bundle.json 
Downloading http://<my toran host>/repo/packagist/p/naroga/metronic-bundle.json 
name  : naroga/metronic-bundle 
descrip. : 
keywords : 
versions : dev-master 
type  : library 
license : 
source : [git] https://[email protected]/naroga/metronic-bundle.git c8cc1d66cae1e24b7f4039b690c999a083dd5775 
dist  : [zip] http://<my toran host>/repo/private/dists/naroga/metronic-bundle/9999999-dev/c8cc1d66cae1e24b7f4039b690c999a083dd5775.zip c8cc1d66cae1e24b7f4039b690c999a083dd5775 
names : naroga/metronic-bundle 

autoload 
psr-0 
Naroga\MetronicBundle => src 

回答

0

事實證明,toran代理做不像懶惰的方式處理私人存儲庫,就像處理packagist存儲庫一樣。

因此,在添加新的私有存儲庫後,必須運行php bin/cronphp app/console toran:cron

我已重新同步運行此簡單命令的存儲庫,並且我的包現在可見。

+0

啊我看到了,是的,這確實是必要的,除非你設置一個鉤子git repo,以便它告訴toran在每次推送更改時進行更新。 – Seldaek 2015-02-10 15:11:59

2

首先,你可以計算出包是否確實是可見的使用:

composer show naroga/sample-project 

如果沒有列出任何東西,那麼這意味着它在你的Toran回購中根本不存在,這可能表明你在那裏配置錯誤或忘了將它添加到Toran。

本身就是下面這行沒有多大的意義,它只是意味着作曲家尋找一個包中的toran回購,但它不能保證它的存在:Downloading http://<my toran host>/repo/packagist/p/naroga/metronic-bundle.json

+0

它確實顯示包。這是來自示例項目文件夾內部的'composer show naroga/metronic-bundle -vvv':https://gist.github.com/naroga/afc1ec2eaa1659d1053e – 2015-02-10 11:24:25

相關問題