我正在尝试创建一个新的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.我使用的是Windows10,安装了php 5.6.30。
我已经尝试过更新composer本身和laravel的安装程序(通过composer global需要"laravel/ installer "),但它仍然不起作用。
我最后一次用这台电脑是在三个星期前,当时它还能用。
编辑:我不能更改我的PHP版本,因为它是我在服务器上使用的版本。
发布于 2017-08-07 17:06:36
看起来您正在尝试下载laravel的最新版本。虽然是5.4,但由于某些原因,它正在下载仅与PHP7兼容的laravel版本尝试使用composer create-project --prefer-dist laravel/laravel blog "5.4.*"安装laravel 5.4
发布于 2017-08-09 15:42:33
这只是phpunit版本。将版本更改为更小,如下所示:
"phpunit/phpunit": "~5.7"
至
"phpunit/phpunit": "~5.0"
https://stackoverflow.com/questions/45542982
复制相似问题