更新作曲家时出现问题

时间:2016-01-15 08:00:51

标签: php laravel laravel-5 composer-php laravel-5.1

我在尝试在Laravel中创建控制器时遇到问题因此决定尝试更新作曲家,并在运行[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]  

尝试创建新控制器时出现的错误;

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
 Composer\EventDispatcher\EventDispatcher->doDispatch() at phar:///usr/local/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php:94
 Composer\EventDispatcher\EventDispatcher->dispatchScript() at phar:///usr/local/bin/composer/src/Composer/Installer.php:196
 Composer\Installer->run() at phar:///usr/local/bin/composer/src/Composer/Command/UpdateCommand.php:159
 Composer\Command\UpdateCommand->execute() at phar:///usr/local/bin/composer/vendor/symfony/console/Command/Command.php:259
 Symfony\Component\Console\Command\Command->run() at phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:840
 Symfony\Component\Console\Application->doRunCommand() at phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:192
 Symfony\Component\Console\Application->doRun() at phar:///usr/local/bin/composer/src/Composer/Console/Application.php:167
 Composer\Console\Application->doRun() at phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:123
 Symfony\Component\Console\Application->run() at phar:///usr/local/bin/composer/src/Composer/Console/Application.php:98
 Composer\Console\Application->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>]...

所以我相信2要连接但是我可能不正确。

输出作曲家更新-vvv

$('.btn-frm').click(function(e){ //this is common to all submit btns in the form
  e.preventDefault(); //this stops the form from submitting

  var btnId = $(this).attr('id') //get the btn id

  if(btnId == 'investidname'){
    //change form action invest, could use $('formid').attr('action', 'pathtoend');
  }else if(btnId == 'borrowname'){
   //change form action borrow, could use $('formid').attr('action', 'pathtoend');
  }

  $('#formid').submit();//since, we have changed the path, submit it
});

2 个答案:

答案 0 :(得分:3)

undefined method [package]通常可以尝试使用在Laravel 5中为Laravel 4构建的包。

从Laravel 5 +中的服务提供商处删除了package方法。

检查任何包服务提供商,以便在提供商处调用package方法。

答案 1 :(得分:0)

你可以尝试这个命令。通常,当我的php artisan或composer命令抛出错误时,它会帮助我。

composer dump-autoload

php artisan cache:clear