2013-04-03 33 views
8

Tôi đã tạo một dự án Symfony 2.1 mới và thêm một gói tùy chỉnh được tải xuống bởi một repo SVN. Bây giờ tôi tryng để nâng cấp dự án để Symfony 2.2, nhưng bất cứ khi nào tôi cố gắng thực hiện lệnh php ~/bin/composer.phar update được thông báo lỗi sau xuất hiện:Cập nhật php composer.phar không thành công - Một lỗi đánh máy trong tên gói

Loading composer repositories with package information 
Updating dependencies (including require-dev)   
Your requirements could not be resolved to an installable set of packages. 

    Problem 1 
    - The requested package custom/utils 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. 

Đây là Symfony 2.2 composer.json:

{ 
    "name": "symfony/framework-standard-edition", 
    "description": "The \"Symfony Standard Edition\" distribution", 
    "autoload": { 
     "psr-0": { "": "src/" } 
    }, 
    "repositories": [ 
     { 
      "type": "vcs", 
      "url": "svn+ssh://sources.de.ext/usr/local/svnroot/utils" 
     } 
    ], 
    "require": { 
     "php": ">=5.3.3", 
     "symfony/symfony": "2.2.*", 
     "doctrine/orm": "~2.2,>=2.2.3", 
     "doctrine/doctrine-bundle": "1.2.*", 
     "twig/extensions": "1.0.*", 
     "symfony/assetic-bundle": "2.1.*", 
     "symfony/swiftmailer-bundle": "2.2.*", 
     "symfony/monolog-bundle": "2.2.*", 
     "sensio/distribution-bundle": "2.2.*", 
     "sensio/framework-extra-bundle": "2.2.*", 
     "sensio/generator-bundle": "2.2.*", 
     "jms/security-extra-bundle": "1.4.*", 
     "jms/di-extra-bundle": "1.3.*", 
     "custom/utils": "*" 
    }, 
    "scripts": { 
     "post-install-cmd": [ 
      "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap", 
      "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache", 
      "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets", 
      "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile" 
     ], 
     "post-update-cmd": [ 
      "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap", 
      "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache", 
      "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets", 
      "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile" 
     ] 
    }, 
    "config": { 
     "bin-dir": "bin" 
    }, 
    "minimum-stability": "alpha", 
    "extra": { 
     "symfony-app-dir": "app", 
     "symfony-web-dir": "web", 
     "branch-alias": { 
      "dev-master": "2.2-dev" 
     } 
    } 
} 

Tuỳ chỉnh utils có sau composer.json:

{ 
    "name": "custom/utils", 
    "version": "1.0.0", 
    "description": "The Custom Libraries", 
    "autoload": { 
     "psr-0": { 
      "Blogo": "src/", 
      "WideImage": "lib/" 
     } 
    }, 
    "require": { 
     "symfony/console": "2.*", 
     "symfony/yaml": "2.*" 
    } 
} 

Có thể ai đó giúp tôi hiểu điều gì sai trong mới 2.2 Symfony? Bởi vì thông báo lỗi này chỉ xuất hiện nâng cấp Symfony 2.2.

+0

Hãy thử thay thế '*' trong '" tùy chỉnh/utils ":" * "' dòng với 'dev-master' –

+0

Cảm ơn, tôi đã thử với' "tùy chỉnh/utils": "1.0.0" ', và nhận được thông báo lỗi: 'Không thể tìm thấy gói tùy chỉnh/utils 1.0.0 được yêu cầu'. – freedev

+0

1.0.0 có thể không phải là phiên bản hợp lệ. Hầu hết các bó sử dụng 'dev-master' theo như tôi biết (tôi khá mới đối với Symfony). –

Trả lời

8

Thử chạy composer update --verbose hoặc composer show custom/utils --verbose. Cả hai sẽ cho bạn thấy một số đầu ra về việc tải kho SVN của bạn. Nó sẽ cho biết phiên bản nào được tải hay không.

Tôi đoán là bạn có phiên bản dev-trunk khả dụng và nếu bạn yêu cầu, phiên bản này rất có thể sẽ hoạt động. Bạn không nên chỉ định version: 1.0.0 trong composer.json của mình, bởi vì nhà soạn nhạc đọc thông tin phiên bản từ thẻ/chi nhánh trong VCS của bạn.

+0

Tôi đã cố gắng làm theo đề xuất của bạn, vì vậy tôi đã xóa phiên bản thành '" custom/utils "' 'composer.json'. Không có gì thay đổi. Sau khi tôi cố gắng chỉ định '" trunk "' làm phiên bản vào Symfony 2.2 'composer.json'. Một thông báo lỗi mới đã xuất hiện: '" Yêu cầu của bạn không thể được giải quyết thành bộ gói có thể cài đặt. Bài toán 1 - Yêu cầu cài đặt cho thân cây blogo/utils -> được yêu cầu bởi blogo/utils dev-trunk - Yêu cầu xóa cho blogo/utils == 9999999-dev' – freedev

+2

Phiên bản là 'dev-trunk' không phải' trunk'. Composer tiền tố tên chi nhánh với 'dev-' để xác định rõ ràng chúng là mục tiêu không ổn định (so với các thẻ không thay đổi theo thời gian) . – Seldaek

Các vấn đề liên quan