概述
Composer install 报错
项目构建命令:
composer install --no-dev --no-interaction -o --ignore-platform-reqs
构建输出:没有错误,陷入死循环
> IlluminateFoundationComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi
Discovered Package: elfsundae/laravel-hashid
Discovered Package: fideloper/proxy
Discovered Package: fruitcake/laravel-cors
Discovered Package: intervention/image
Discovered Package: laravel/tinker
Discovered Package: maatwebsite/excel
Discovered Package: milon/barcode
Discovered Package: nesbot/carbon
Discovered Package: overtrue/laravel-wechat
Discovered Package: sentry/sentry-laravel
Discovered Package: shallowman/laralog
Discovered Package: tymon/jwt-auth
Package manifest generated successfully.
69 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
Loading composer repositories with package information
Warning: Accessing gitlab.zz-med-stg.com over http which is an insecure protocol.
Updating dependencies
Lock file operations: 0 installs, 3 updates, 0 removals
- Downgrading symfony/http-client (v6.2.6 => v5.4.20)
- Downgrading symfony/http-client-contracts (v3.1.1 => v2.5.2)
- Upgrading symfony/http-kernel (v4.4.13 => v4.4.50)
Writing lock file
Installing dependencies from lock file
Package operations: 0 installs, 3 updates, 0 removals
- Downgrading symfony/http-client-contracts (v3.1.1 => v2.5.2): Extracting archive
- Upgrading symfony/http-kernel (v4.4.13 => v4.4.50): Extracting archive
- Downgrading symfony/http-client (v6.2.6 => v5.4.20): Extracting archive
101 package suggestions were added by new dependencies, use `composer suggest` to see details.
Package overtrue/wechat is abandoned, you should avoid using it. Use w7corp/easywechat instead.
Package swiftmailer/swiftmailer is abandoned, you should avoid using it. Use symfony/mailer instead.
Package symfony/debug is abandoned, you should avoid using it. Use symfony/error-handler instead.
Package php-cs-fixer/diff is abandoned, you should avoid using it. No replacement was suggested.
Generating optimized autoload files
Class AppServicesDataDepartmentDataBoardRoomIdService located in ./app/Services/Data/Department/DataBoardRoomidService.php does not comply with psr-4 autoloading standard. Skipping.
> IlluminateFoundationComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi
Discovered Package: elfsundae/laravel-hashid
Discovered Package: fideloper/proxy
Discovered Package: fruitcake/laravel-cors
Discovered Package: intervention/image
Discovered Package: laravel/tinker
Discovered Package: maatwebsite/excel
Discovered Package: milon/barcode
Discovered Package: nesbot/carbon
Discovered Package: overtrue/laravel-wechat
Discovered Package: sentry/sentry-laravel
Discovered Package: shallowman/laralog
Discovered Package: tymon/jwt-auth
Package manifest generated successfully.
69 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
Loading composer repositories with package information
Warning: Accessing gitlab.zz-med-stg.com over http which is an insecure protocol.
Updating dependencies
Lock file operations: 0 installs, 3 updates, 0 removals
- Upgrading symfony/http-client (v5.4.20 => v6.2.6)
- Upgrading symfony/http-client-contracts (v2.5.2 => v3.1.1)
- Downgrading symfony/http-kernel (v4.4.50 => v4.4.13)
Writing lock file
Installing dependencies from lock file
Package operations: 0 installs, 3 updates, 0 removals
- Downgrading symfony/http-kernel (v4.4.50 => v4.4.13): Extracting archive
- Upgrading symfony/http-client-contracts (v2.5.2 => v3.1.1): Extracting archive
- Upgrading symfony/http-client (v5.4.20 => v6.2.6): Extracting archive
101 package suggestions were added by new dependencies, use `composer suggest` to see details.
Package overtrue/wechat is abandoned, you should avoid using it. Use w7corp/easywechat instead.
Package swiftmailer/swiftmailer is abandoned, you should avoid using it. Use symfony/mailer instead.
Package symfony/debug is abandoned, you should avoid using it. Use symfony/error-handler instead.
Package php-cs-fixer/diff is abandoned, you should avoid using it. No replacement was suggested.
Generating optimized autoload files
Class AppServicesDataDepartmentDataBoardRoomIdService located in ./app/Services/Data/Department/DataBoardRoomidService.php does not comply with psr-4 autoloading standard. Skipping.
> IlluminateFoundationComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi
Discovered Package: elfsundae/laravel-hashid
Discovered Package: fideloper/proxy
Discovered Package: fruitcake/laravel-cors
Discovered Package: intervention/image
Discovered Package: laravel/tinker
Discovered Package: maatwebsite/excel
Discovered Package: milon/barcode
Discovered Package: nesbot/carbon
Discovered Package: overtrue/laravel-wechat
Discovered Package: sentry/sentry-laravel
Discovered Package: shallowman/laralog
Discovered Package: tymon/jwt-auth
Package manifest generated successfully.
69 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
Loading composer repositories with package information
Warning: Accessing gitlab.zz-med-stg.com over http which is an insecure protocol.
解决办法:
1、 升级composer版本
由composer v2.0.8升至 v2.5.2
composer self-update --stable
升级了版本之后,
报错1:
In PluginManager.php line 738:
php-http/discovery contains a Composer plugin which is blocked by your allo
w-plugins config. You may add it to the list if you consider it safe.
You can run "composer config --no-plugins allow-plugins.php-http/discovery
[true|false]" to enable it (true) or disable it explicitly and suppress thi
s exception (false)
See https://getcomposer.org/allow-plugins
install [--prefer-source] [--prefer-dist] [--prefer-install PREFER-INSTALL] [--dry-run] [--download-only] [--dev] [--no-suggest] [--no-dev] [--no-autoloader] [--no-progress] [--no-install] [--audit] [--audit-format AUDIT-FORMAT] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--apcu-autoloader-prefix APCU-AUTOLOADER-PREFIX] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--] [<packages>...]
ERROR: Job failed: command terminated with exit code 1
报错2:
In PluginManager.php line 738:
easywechat-composer/easywechat-composer contains a Composer plugin which is
blocked by your allow-plugins config. You may add it to the list if you co
nsider it safe.
You can run "composer config --no-plugins allow-plugins.easywechat-composer
/easywechat-composer [true|false]" to enable it (true) or disable it explic
itly and suppress this exception (false)
See https://getcomposer.org/allow-plugins
install [--prefer-source] [--prefer-dist] [--prefer-install PREFER-INSTALL] [--dry-run] [--download-only] [--dev] [--no-suggest] [--no-dev] [--no-autoloader] [--no-progress] [--no-install] [--audit] [--audit-format AUDIT-FORMAT] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--apcu-autoloader-prefix APCU-AUTOLOADER-PREFIX] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--] [<packages>...]
ERROR: Job failed: command terminated with exit code 1
2、升级后报错解决:
根据报错,在composer.json文件中添加对应插件
"config": {
"allow-plugins": {
"php-http/discovery": false,
"easywechat-composer/easywechat-composer": false
}
},
最后
以上就是繁荣豌豆为你收集整理的Composer install 报错的全部内容,希望文章能够帮你解决Composer install 报错所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复