我在尝试在Laravel中创建控制器时遇到问题,因此决定尝试更新作曲家,并在运行composer update
时遇到以下问题;
[BadMethodCallException]
Call to undefined method [package]
Script php artisan clear-compiled handling the pre-update-cmd event returned with an error
[RuntimeException]
Error Output:
update [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--lock] [--no-plugins] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--with-dependencies] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [-i|--interactive] [--] [<packages>]...
尝试创建新控制器时遇到的错误;
[BadMethodCallException]
Call to undefined method [package]
所以我相信 2 是连接的,但我可能是不正确的。
作曲家更新的输出 -vvv
Reading ./composer.json
Loading config file ./composer.json
Executing command (/Users/kieran/Sites/Dev/laravel): git describe --exact-match --tags
Executing command (/Users/kieran/Sites/Dev/laravel): git branch --no-color --no-abbrev -v
Executing command (/Users/kieran/Sites/Dev/laravel): hg branch
Executing command (/Users/kieran/Sites/Dev/laravel): svn info --xml
Reading /Users/kieran/.composer/composer.json
Loading config file /Users/kieran/.composer/composer.json
> pre-update-cmd: php artisan clear-compiled
Executing command (CWD): php artisan clear-compiled
[BadMethodCallException]
Call to undefined method [package]
Script php artisan clear-compiled handling the pre-update-cmd event returned with an error
[RuntimeException]
Error Output:
Exception trace:
() at phar:///usr/local/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php:196
ComposerEventDispatcherEventDispatcher->doDispatch() at phar:///usr/local/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php:94
ComposerEventDispatcherEventDispatcher->dispatchScript() at phar:///usr/local/bin/composer/src/Composer/Installer.php:196
ComposerInstaller->run() at phar:///usr/local/bin/composer/src/Composer/Command/UpdateCommand.php:159
ComposerCommandUpdateCommand->execute() at phar:///usr/local/bin/composer/vendor/symfony/console/Command/Command.php:259
SymfonyComponentConsoleCommandCommand->run() at phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:840
SymfonyComponentConsoleApplication->doRunCommand() at phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:192
SymfonyComponentConsoleApplication->doRun() at phar:///usr/local/bin/composer/src/Composer/Console/Application.php:167
ComposerConsoleApplication->doRun() at phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:123
SymfonyComponentConsoleApplication->run() at phar:///usr/local/bin/composer/src/Composer/Console/Application.php:98
ComposerConsoleApplication->run() at phar:///usr/local/bin/composer/bin/composer:43
require() at /usr/local/bin/composer:25
update [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--lock] [--no-plugins] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--with-dependencies] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [-i|--interactive] [--] [<packages>]...
undefined method [package]
通常是尝试使用在 Laravel 4 中为 Laravel 5 构建的软件包。
package
方法已从Laravel 5+中的服务提供商中删除。
检查任何包服务提供程序,以调用提供程序上的package
方法。
您可以尝试此命令。通常,当我的php工匠或作曲家命令抛出并出错时,它有时会帮助我。
composer dump-autoload
也
php artisan cache:clear