Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

composer require 报错 #9

Closed
winson-young opened this issue Jun 7, 2023 · 4 comments
Closed

composer require 报错 #9

winson-young opened this issue Jun 7, 2023 · 4 comments

Comments

@winson-young
Copy link

winson-young commented Jun 7, 2023

> post-package-install: support\Plugin::install
Script support\Plugin::install handling the post-package-install event terminated with an exception
Downloading https://packagist.org/downloads/
[201] https://packagist.org/downloads/

In ClassLoader.php line 582:
                                                                                                                                         
  [ErrorException]                                                                                                                       
  include(/mnt/projects/app-backend/vendor/tinywan/exception-handler/src/Install.php): failed to open stream: No such file or directory  
                                                                                                                                         

Exception trace:
  at phar:///usr/local/bin/composer/vendor/composer/ClassLoader.php:582
 Composer\Util\ErrorHandler::handle() at phar:///usr/local/bin/composer/vendor/composer/ClassLoader.php:582
 include() at phar:///usr/local/bin/composer/vendor/composer/ClassLoader.php:582
 Composer\Autoload\{closure}() at phar:///usr/local/bin/composer/vendor/composer/ClassLoader.php:433
 Composer\Autoload\ClassLoader->loadClass() at n/a:n/a
 spl_autoload_call() at n/a:n/a
 defined() at /mnt/projects/app-backend/vendor/workerman/webman-framework/src/support/Plugin.php:23
 support\Plugin::install() at phar:///usr/local/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php:439
 Composer\EventDispatcher\EventDispatcher->executeEventPhpScript() at phar:///usr/local/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php:257
 Composer\EventDispatcher\EventDispatcher->doDispatch() at phar:///usr/local/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php:148
 Composer\EventDispatcher\EventDispatcher->dispatchPackageEvent() at phar:///usr/local/bin/composer/src/Composer/Installer/InstallationManager.php:396
 Composer\Installer\InstallationManager::Composer\Installer\{closure}() at phar:///usr/local/bin/composer/src/Composer/Installer/InstallationManager.php:411
 Composer\Installer\InstallationManager->executeBatch() at phar:///usr/local/bin/composer/src/Composer/Installer/InstallationManager.php:319
 Composer\Installer\InstallationManager->downloadAndExecuteBatch() at phar:///usr/local/bin/composer/src/Composer/Installer/InstallationManager.php:218
 Composer\Installer\InstallationManager->execute() at phar:///usr/local/bin/composer/src/Composer/Installer.php:797
 Composer\Installer->doInstall() at phar:///usr/local/bin/composer/src/Composer/Installer.php:622
 Composer\Installer->doUpdate() at phar:///usr/local/bin/composer/src/Composer/Installer.php:287
 Composer\Installer->run() at phar:///usr/local/bin/composer/src/Composer/Command/RequireCommand.php:490
 Composer\Command\RequireCommand->doUpdate() at phar:///usr/local/bin/composer/src/Composer/Command/RequireCommand.php:339
 Composer\Command\RequireCommand->execute() at phar:///usr/local/bin/composer/vendor/symfony/console/Command/Command.php:298
 Symfony\Component\Console\Command\Command->run() at phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:1040
 Symfony\Component\Console\Application->doRunCommand() at phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:301
 Symfony\Component\Console\Application->doRun() at phar:///usr/local/bin/composer/src/Composer/Console/Application.php:378
 Composer\Console\Application->doRun() at phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:171
 Symfony\Component\Console\Application->run() at phar:///usr/local/bin/composer/src/Composer/Console/Application.php:141
 Composer\Console\Application->run() at phar:///usr/local/bin/composer/bin/composer:88
 require() at /usr/local/bin/composer:29

require [--dev] [--dry-run] [--prefer-source] [--prefer-dist] [--prefer-install PREFER-INSTALL] [--fixed] [--no-suggest] [--no-progress] [--no-update] [--no-install] [--no-audit] [--audit-format AUDIT-FORMAT] [--update-no-dev] [-w|--update-with-dependencies] [-W|--update-with-all-dependencies] [--with-dependencies] [--with-all-dependencies] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--apcu-autoloader-prefix APCU-AUTOLOADER-PREFIX] [--] [<packages>...]

走到安装插件的这一步就报错了,虽然再安装一次就不报错了,但是运行起来会有问题,config方法获取不了配置了。

@winson-young
Copy link
Author

补充一下环境
php:7.4.27
composer: 2.5.7
webman:1.5.0

@winson-young
Copy link
Author

./composer.json has been updated
Running composer update tinywan/exception-handler
Loading composer repositories with package information
Updating dependencies
Lock file operations: 1 install, 0 updates, 0 removals
  - Locking tinywan/exception-handler (v1.1.5)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
  - Installing tinywan/exception-handler (v1.1.5): Extracting archive
> support\Plugin::install
Script support\Plugin::install handling the post-package-install event terminated with an exception

In ClassLoader.php line 582:
                                                                                                                                         
  include(/mnt/projects/app-backend/vendor/tinywan/exception-handler/src/Install.php): failed to open stream: No such file or directory  
                                                                                                                                         

require [--dev] [--dry-run] [--prefer-source] [--prefer-dist] [--prefer-install PREFER-INSTALL] [--fixed] [--no-suggest] [--no-progress] [--no-update] [--no-install] [--no-audit] [--audit-format AUDIT-FORMAT] [--update-no-dev] [-w|--update-with-dependencies] [-W|--update-with-all-dependencies] [--with-dependencies] [--with-all-dependencies] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--apcu-autoloader-prefix APCU-AUTOLOADER-PREFIX] [--] [<packages>...]

完整报错如上

@winson-young
Copy link
Author

问题已解决,运行composer dump-autoload -o重新生成classmap后解决

@Tinywan
Copy link
Owner

Tinywan commented Jun 9, 2023

好的,吓我一条

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants