我正在尝试创建一个新的laravel应用程序,但是当我使用“laravel new”命令时,我遇到了错误:
laravel new
Crafting application...
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 phpunit/php-token-stream 2.0.0 -> satisfiable by phpunit/php-token-stream[2.0.0].
- phpunit/php-token-stream 2.0.0 requires php ^7.0 -> your PHP version (5.6.30) does not satisfy that requirement. Problem 2
- phpunit/php-token-stream 2.0.0 requires php ^7.0 -> your PHP version (5.6.30) does not satisfy that requirement.
- phpunit/php-code-coverage 4.0.8 requires phpunit/php-token-stream ^1.4.2 || ^2.0 -> satisfiable by phpunit/php-token-stream[2.0.0].
- Installation request for phpunit/php-code-coverage 4.0.8 -> satisfiable by phpunit/php-code-coverage[4.0.8].
Application ready! Build something amazing.
我在Windows 10上安装了PHP 5.6.30。
我已经尝试过更新作曲家本身,以及laravel的安装程序(通过作曲家全局需要“laravel / installer”),但它仍然不起作用。
上次我试用这台电脑是在三周前,然后就可以了。
编辑:我无法更改我的PHP版本,因为它是我在服务器上使用的版本。
答案 0 :(得分:2)
看起来您正在尝试下载laravel的最新版本。虽然它是5.4但是出于某种原因,它正在下载仅与PHP7
兼容的laravel版本
尝试使用composer create-project --prefer-dist laravel/laravel blog "5.4.*"
安装laravel 5.4
答案 1 :(得分:0)
它只是phpunit版本。将版本更改为更小,例如:
"phpunit/phpunit": "~5.7"
到
"phpunit/phpunit": "~5.0"