2015-03-03 35 views
0

的,而且我有一個很難通過composer.jsonPHP作曲家沒有安裝 - 您的要求不能被解析到一個可安裝一套我剛剛成立<code>Slim Framework for PHP</code>包

我composer.json安裝超薄/視圖庫看起來是這樣的:

{ 
    "name": "slim/slim", 
    "type": "library", 
    "description": "Slim Framework, a PHP micro framework", 
    "keywords": ["microframework","rest","router"], 
    "homepage": "http://github.com/codeguy/Slim", 
    "license": "MIT", 
    "authors": [ 
     { 
      "name": "Josh Lockhart", 
      "email": "[email protected]", 
      "homepage": "http://www.joshlockhart.com/" 
     } 
    ], 
    "require": { 
     "php": ">=5.3.0", 
     "phing/phing": "2.*" 
    }, 
    "suggest": { 
     "ext-mcrypt": "Required for HTTP cookie encryption" 
    }, 
    "autoload": { 
     "psr-0": { "Slim": "." } 
    } 
} 

當我說 composer require slim/views,我得到這個錯誤,這我不知道它在談論:

Problem 1 
    - slim/views 0.1.0 requires slim/slim >=2.0.0 -> satisfiable by slim/slim[2.0.0, 2.1.0, 2.2.0, 2.3.0, 2.3.1, 2.3.2, 2.3.3, 2.3.4, 2.3.5, 2.4.0, 2.4.1, 2.4.2, 2.4.3, 2.5.0, 2.6.0, 2.6.1]. 
    - slim/views 0.1.1 requires slim/slim >=2.4.0 -> satisfiable by slim/slim[2.4.0, 2.4.1, 2.4.2, 2.4.3, 2.5.0, 2.6.0, 2.6.1]. 
    - slim/views 0.1.2 requires slim/slim >=2.4.0 -> satisfiable by slim/slim[2.4.0, 2.4.1, 2.4.2, 2.4.3, 2.5.0, 2.6.0, 2.6.1]. 
    - slim/views 0.1.3 requires slim/slim >=2.4.0 -> satisfiable by slim/slim[2.4.0, 2.4.1, 2.4.2, 2.4.3, 2.5.0, 2.6.0, 2.6.1]. 
    - Can only install one of: slim/slim[2.0.0, 1.0.0]. 
    - Can only install one of: slim/slim[2.1.0, 1.0.0]. 
    - Can only install one of: slim/slim[2.2.0, 1.0.0]. 
    - Can only install one of: slim/slim[2.3.0, 1.0.0]. 
    - Can only install one of: slim/slim[2.3.1, 1.0.0]. 
    - Can only install one of: slim/slim[2.3.2, 1.0.0]. 
    - Can only install one of: slim/slim[2.3.3, 1.0.0]. 
    - Can only install one of: slim/slim[2.3.4, 1.0.0]. 
    - Can only install one of: slim/slim[2.3.5, 1.0.0]. 
    - Can only install one of: slim/slim[2.4.0, 1.0.0]. 
    - Can only install one of: slim/slim[2.4.1, 1.0.0]. 
    - Can only install one of: slim/slim[2.4.2, 1.0.0]. 
    - Can only install one of: slim/slim[2.4.3, 1.0.0]. 
    - Can only install one of: slim/slim[2.5.0, 1.0.0]. 
    - Can only install one of: slim/slim[2.6.0, 1.0.0]. 
    - Can only install one of: slim/slim[2.6.1, 1.0.0]. 
    - Installation request for slim/slim 1.0.0 -> satisfiable by slim/slim[1.0.0]. 
    - Installation request for slim/views 0.1.* -> satisfiable by slim/views[0.1.0, 0.1.1, 0.1.2, 0.1.3]. 

目前Slim Framework的版本是2.6.1。我發現的一件事是,如果我在我的composer.json中指定"version":"2.6.1",在之前的name標籤之後,composer require運行良好,並且軟件包已安裝。不知道發生了什麼;有人可以幫我這個嗎?

謝謝!

+2

可能,版本默認爲1.0.0。如果您使用自己的名字(「spanguluri/appname」),那麼它可能會更好,並且將slim/slim添加到您的需求列表中。 – 2015-03-03 06:03:53

+0

工作,謝謝! – 2015-03-09 20:07:05

回答

3

正如ChrisForrence所指,您的軟件包名稱slim/slim與具有相同名稱的庫相沖突。 將您的包名更改爲別的,slim將按預期方式安裝。

"name": "sasanka/my-app" 
+1

謝謝!我剛剛發現我以錯誤的方式使用了Composer,所以我最終遇到了這個問題。 – 2015-03-09 20:07:37

相關問題