2017-12-18 104 views
-1

我想在我的項目上運行composer install時發生錯誤。 象這樣的錯誤發出:作曲家安裝 - 您的要求無法解析爲可安裝的一組套件

[email protected]:~/Triplogic/tripologic-admin-laravel$ sudo composer install 
Loading composer repositories with package information 
Installing dependencies (including require-dev) from lock file 
Your requirements could not be resolved to an installable set of packages. 

    Problem 1 
    - Installation request for symfony/event-dispatcher v4.0.1 -> satisfiable by symfony/event-dispatcher[v4.0.1]. 
    - symfony/event-dispatcher v4.0.1 requires php ^7.1.3 -> your PHP version (7.0.22) does not satisfy that requirement. 
    Problem 2 
    - Installation request for doctrine/instantiator 1.1.0 -> satisfiable by doctrine/instantiator[1.1.0]. 
    - doctrine/instantiator 1.1.0 requires php ^7.1 -> your PHP version (7.0.22) does not satisfy that requirement. 
    Problem 3 
    - Installation request for symfony/yaml v4.0.1 -> satisfiable by symfony/yaml[v4.0.1]. 
    - symfony/yaml v4.0.1 requires php ^7.1.3 -> your PHP version (7.0.22) does not satisfy that requirement. 
    Problem 4 
    - symfony/event-dispatcher v4.0.1 requires php ^7.1.3 -> your PHP version (7.0.22) does not satisfy that requirement. 
    - symfony/http-kernel v3.4.1 requires symfony/event-dispatcher ~2.8|~3.0|~4.0 -> satisfiable by symfony/event-dispatcher[v4.0.1]. 
    - Installation request for symfony/http-kernel v3.4.1 -> satisfiable by symfony/http-kernel[v3.4.1]. 

,我有我的composer.json文件是這樣的:

{ 
    "name": "laravel/laravel", 
    "description": "The Laravel Framework.", 
    "keywords": ["framework", "laravel"], 
    "license": "MIT", 
    "type": "project", 
    "require": { 
     "php": ">=5.6.4", 
     "brozot/laravel-fcm": "^1.2", 
     "guzzlehttp/guzzle": "^6.3", 
     "laravel/framework": "5.4.*", 
     "laravel/tinker": "~1.0", 
     "maatwebsite/excel": "^2.1", 
     "prettus/l5-repository": "^2.6", 
     "pusher/pusher-php-server": "^3.0", 
     "yajra/laravel-datatables-oracle": "8.*", 
     "zizaco/entrust": "5.2.x-dev" 
    }, 
    "require-dev": { 
     "fzaninotto/faker": "~1.4", 
     "mockery/mockery": "0.9.*", 
     "phpunit/phpunit": "~5.7" 
    }, 
    "autoload": { 
     "classmap": [ 
      "database" 
     ], 
     "psr-4": { 
      "App\\": "app/" 
     }, 
     "files": [ 
      "app/Helper/HelperFunction.php" 
     ] 
    }, 
    "autoload-dev": { 
     "psr-4": { 
      "Tests\\": "tests/" 
     } 
    }, 
    "scripts": { 
     "post-root-package-install": [ 
      "php -r \"file_exists('.env') || copy('.env.example', '.env');\"" 
     ], 
     "post-create-project-cmd": [ 
      "php artisan key:generate" 
     ], 
     "post-install-cmd": [ 
      "Illuminate\\Foundation\\ComposerScripts::postInstall", 
      "php artisan optimize" 
     ], 
     "post-update-cmd": [ 
      "Illuminate\\Foundation\\ComposerScripts::postUpdate", 
      "php artisan optimize" 
     ] 
    }, 
    "config": { 
     "preferred-install": "dist", 
     "sort-packages": true, 
     "optimize-autoloader": true 
    } 
} 

人誰可以幫我,這將是非常有益的。

+3

_「symfony/event-dispatcher v4.0.1需要php^7.1.3 - >您的PHP版本(7.0.22)不滿足該要求」_ <=非常自我解釋? –

回答

4

第一點:不要使用root權限運行composer - 沒有必要,它只會在以後引發問題。

二點:此行顯示的所有內容:

symfony/event-dispatcher v4.0.1 requires php ^7.1.3 -> your PHP version (7.0.22) does not satisfy that requirement. 

所以:你要安裝的Symfony V4需要在V7.1.3 PHP或者使用PHP 7.0.22更高。這根本不可能。要麼更新您的PHP安裝或使用Symfony 3.4

+1

非常感謝你幫助我。最後我的問題解決了@MagnusEriksson –

+1

非常感謝你的幫助。最後我的問題解決了@NicoHaase –

相關問題