我无法运行 composer update 命令 laravel 5.3 项目
Posted
技术标签:
【中文标题】我无法运行 composer update 命令 laravel 5.3 项目【英文标题】:i can't run composer update command laravel 5.3 project 【发布时间】:2018-09-22 07:17:45 【问题描述】:"require":
"php": ">=5.5.9",
"laravel/framework": "5.2.*",
"laravelcollective/html": "*.*"
,
"require-dev":
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~4.0",
"symfony/css-selector": "2.8.*|3.0.*",
"symfony/dom-crawler": "2.8.*|3.0.*"
,
"autoload":
"classmap": [
"database"
],
"psr-4":
"App\\": "app/"
,
"files": [
"app/Libraries/Functions.php"
]
,
"autoload-dev":
"classmap": [
"tests/TestCase.php"
]
,
"scripts":
"post-root-package-install": [
"php -r \"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"
我无法在 5.3 项目中运行命令 composer update。我想在运行命令发生错误时运行命令作曲家更新。没有设置 php 版本。我想运行 php 5.6 版和 laravel 5.3 版。
这是我的作曲家文件:
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require":
"php": ">=5.6.4",
"laravel/framework": "5.3.*"
,
"require-dev":
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~5.0",
"symfony/css-selector": "3.1.*",
"symfony/dom-crawler": "3.1.*"
,
"autoload":
"classmap": [
"database"
],
"psr-4":
"App\\": "app/"
,
"autoload-dev":
"classmap": [
"tests/TestCase.php"
]
,
"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"
【问题讨论】:
发布你得到的完整错误。此外,"laravel/framework": "5.2.*"
看起来您想使用 5.2
,而不是 5.3
。
【参考方案1】:
先composer clearcache
,然后composer update
Laravel version
或者你可以使用composer update --prefer-source
【讨论】:
不满足该要求。 - laravel/framework v5.3.29 需要 php >=5.6.4 -> 你的 PHP 版本 (5.6.3) 尝试升级你的php版本再试一次 我不想更改 xampp 版本 您可以查看我的答案并查看文档。laravel 5.3 仅适用于 php 版本 5.6.4 或更高版本以上是关于我无法运行 composer update 命令 laravel 5.3 项目的主要内容,如果未能解决你的问题,请参考以下文章
Laravel - 在我运行 composer update CLI artisan 之后出现问题
来自git clone的Laravel项目无法正常工作(无法使用key:generate或composer install / update)