如何解决使用 Composer 安装 PHP 8 时出现包错误
我想运行从 Gitlab 存储库克隆的 laravel 应用程序。但是,在运行 composer update
命令时,我遇到了错误。
环境:
php -v
:PHP 8.0.1
composer --version
:2.0.9
我知道 PHP 8 还没有提供对所有软件包的支持。但仍在寻找最小的工作解决方案来在本地机器上运行我的项目。
我在 laravel 中尝试了以下 article。但也无法安装“fakerphp/faker”。
Problem 1
- tymon/jwt-auth[1.0.0-alpha.2,...,1.0.0-rc.4.1] require php ^5.5.9 || ^7.0 -> your php version (8.0.1; overridden via config.platform,same as actual) does not satisfy that requirement.
- tymon/jwt-auth[1.0.0-rc.5,1.0.2] require php ^5.5.9|^7.0 -> your php version (8.0.1; overridden via config.platform,same as actual) does not satisfy that requirement.
- doctrine/inflector[v1.2.0,1.2.x-dev] require php ^7.0 -> your php version (8.0.1; overridden via config.platform,same as actual) does not satisfy that requirement.
- doctrine/inflector[v1.3.0,1.3.x-dev] require php ^7.1 -> your php version (8.0.1; overridden via config.platform,same as actual) does not satisfy that requirement.
- doctrine/inflector[1.4.0,1.4.1,2.0.0,2.0.1] require php ^7.2 -> your php version (8.0.1; overridden via config.platform,same as actual) does not satisfy that requirement.
- tymon/jwt-auth 1.0.x-dev is an alias of tymon/jwt-auth dev-develop and thus requires it to be installed too.
- Conclusion: don't install tymon/jwt-auth dev-develop (conflict analysis result)
composer.json
"require": {
"php": "^7.4|^8.0","ext-zip": "*","consoletvs/charts": "^7.1","facade/ignition": "^2.5","fideloper/proxy": "^4.0","guzzlehttp/guzzle": "^7.2","intervention/image": "^2.5","laravel/framework": "^8.14","laravel/passport": "^10.0","laravel/tinker": "^2.5","laravel/ui": "^3.1","phpoffice/phpspreadsheet": "^1.16","sentry/sentry-laravel": "^2.3","tymon/jwt-auth": "^1.0","zanysoft/laravel-zip": "^1.0"
},
我什至删除了我的 composer.lock
并尝试运行 composer install
但仍然出现错误。
解决方法
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。