Laravel编写器更新错误:无需安装或更新

When I run composer update, I get the following error:

Loading composer repositories with package information Updating dependencies (including require-dev) Nothing to install or update Generating autoload files Illuminate\Foundation\ComposerScripts::postUpdate php artisan optimize [Symfony\Component\Debug\Exception\FatalErrorException] Class 'Laravel\Cashier\CashierServiceProvider' not found Script php artisan optimize handling the post-update-cmd event returned with err or code 255

I put this code on the app.php file

Laravel\Cashier\CashierServiceProvider::class,

and in the composer.json I also put this

"laravel/cashier": "~6.0"

like in the laravel doc

stack errot

Remove the

Laravel\Cashier\CashierServiceProvider::class,

from app.php. It needs to be added after installing the package.

Also, instead of composer update, try composer require without changing the composer.json file.

composer require laravel/cashier