解决 composer 安装 laravel 报错

执行#

composer create-project laravel/laravel laravel9

报错
Creating a “laravel/laravel” project at “./laravel9”
Installing laravel/laravel (v10.2.1)
  – Downloading laravel/laravel (v10.2.1)
  – Installing laravel/laravel (v10.2.1): Extracting archive
Created project in /Users/xuweidong/www/laravel9
> @php -r “file_exists(‘.env’) || copy(‘.env.example’, ‘.env’);”
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    – laravel/framework[v10.10.0, …, v10.10.1] require doctrine/inflector ^2.0.5 -> found doctrine/inflector[2.0.x-dev, 2.1.x-dev] but it does not match your minimum-stability.
    – Root composer.json requires laravel/framework ^10.10 -> satisfiable by laravel/framework[v10.10.0, v10.10.1].
解决方法:解除镜像

composer config -l -g

[repositories.packagist.org.type] composer
[repositories.packagist.org.url] mirrors.aliyun.com/composer/

解除镜象:并恢复到 packagist 官方源

composer config -g --unset repos.packagist

成功安装

微信公众号
手机浏览(小程序)
0
分享到:
没有账号? 忘记密码?