【发布时间】:2020-12-12 12:02:32
【问题描述】:
我正在使用带有 php 版本 7.4.13 的 laravel 6,我面临的问题是,当我更新我的作曲家以设置我的项目时,它向我显示错误
In ProviderRepository.php line 208:
Class 'Netshell\Paypal\PaypalServiceProvider' not found
Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1
并在我使用composer require netshell/paypal dev-master 安装 netshell/paypal 时解决该问题
它向我显示错误
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Root composer.json requires netshell/paypal dev-master -> satisfiable by netshell/paypal[dev-master].
- netshell/paypal dev-master requires illuminate/support ~5.0 -> found illuminate/support[v5.0.0, ..., 5.8.x-dev] but it conflicts with another require.
Installation failed, reverting ./composer.json and ./composer.lock to their original content.
我不知道为什么会发生这种情况,我已经更新了下面给出的 composer json 代码
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": "^7.1.3",
"anandsiddharth/laravel-paytm-wallet": "^1.0",
"barryvdh/laravel-dompdf": "^0.8.2",
"fideloper/proxy": "^4.0",
"gabrielbull/ups-api": "^0.8.0",
"guzzlehttp/guzzle": "^6.5",
"instamojo/instamojo-php": "^0.4.0",
"laracasts/flash": "^3.0",
"laravel/framework": "6.*",
"laravel/passport": "^7.3",
"laravel/socialite": "^4.3",
"laravel/tinker": "^1.0",
"maatwebsite/excel": "^3.1",
"mehedi-iitdu/core-component-repository": "dev-master",
"mehedi-iitdu/laravel-paystack": "dev-master",
"mehedi-iitdu/paypal": "dev-master",
"nexmo/laravel": "^2.2",
"razorpay/razorpay": "2.0.0",
"spatie/laravel-image-optimizer": "^1.3",
"stripe/stripe-php": "^6.29",
"twilio/sdk": "^6.1"
},
"require-dev": {
"beyondcode/laravel-dump-server": "^1.0",
"filp/whoops": "^2.0",
"fzaninotto/faker": "^1.4",
"mockery/mockery": "^1.0",
"nunomaduro/collision": "^2.0",
"phpunit/phpunit": "^7.0"
},
"autoload": {
"classmap": [
"database/seeds",
"database/factories"
],
"psr-4": {
"App\\": "app/"
},
"files": ["app/Http/Helpers.php"]
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"extra": {
"laravel": {
"dont-discover": [
]
}
},
"scripts": {
"post-root-package-install": [
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"@php artisan key:generate --ansi"
],
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"@php artisan package:discover --ansi"
]
},
"config": {
"preferred-install": "dist",
"sort-packages": true,
"optimize-autoloader": true
},
"minimum-stability": "dev",
"prefer-stable": true
}
我也正在从 config.php/app.php 上传我的提供程序和别名
'providers' => [
/*
* Laravel Framework Service Providers...
*/
Illuminate\Auth\AuthServiceProvider::class,
Illuminate\Broadcasting\BroadcastServiceProvider::class,
Illuminate\Bus\BusServiceProvider::class,
Illuminate\Cache\CacheServiceProvider::class,
Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class,
Illuminate\Cookie\CookieServiceProvider::class,
Illuminate\Database\DatabaseServiceProvider::class,
Illuminate\Encryption\EncryptionServiceProvider::class,
Illuminate\Filesystem\FilesystemServiceProvider::class,
Illuminate\Foundation\Providers\FoundationServiceProvider::class,
Illuminate\Hashing\HashServiceProvider::class,
Illuminate\Mail\MailServiceProvider::class,
Illuminate\Notifications\NotificationServiceProvider::class,
Illuminate\Pagination\PaginationServiceProvider::class,
Illuminate\Pipeline\PipelineServiceProvider::class,
Illuminate\Queue\QueueServiceProvider::class,
Illuminate\Redis\RedisServiceProvider::class,
Illuminate\Auth\Passwords\PasswordResetServiceProvider::class,
Illuminate\Session\SessionServiceProvider::class,
Illuminate\Translation\TranslationServiceProvider::class,
Illuminate\Validation\ValidationServiceProvider::class,
Illuminate\View\ViewServiceProvider::class,
Laracasts\Flash\FlashServiceProvider::class,
Laravel\Socialite\SocialiteServiceProvider::class,
Netshell\Paypal\PaypalServiceProvider::class,
Barryvdh\DomPDF\ServiceProvider::class,
Mehedi\Paystack\PaystackServiceProvider::class,
MehediIitdu\CoreComponentRepository\CoreComponentRepositoryServiceProvider::class,
Nexmo\Laravel\NexmoServiceProvider::class,
Maatwebsite\Excel\ExcelServiceProvider::class,
Anand\LaravelPaytmWallet\PaytmWalletServiceProvider::class,
\Laravel\Passport\PassportServiceProvider::class,
/*
* Package Service Providers...
*/
/*
* Application Service Providers...
*/
App\Providers\AppServiceProvider::class,
App\Providers\AuthServiceProvider::class,
// App\Providers\BroadcastServiceProvider::class,
App\Providers\EventServiceProvider::class,
App\Providers\RouteServiceProvider::class,
],
'aliases' => [
'App' => Illuminate\Support\Facades\App::class,
'Artisan' => Illuminate\Support\Facades\Artisan::class,
'Auth' => Illuminate\Support\Facades\Auth::class,
'Blade' => Illuminate\Support\Facades\Blade::class,
'Broadcast' => Illuminate\Support\Facades\Broadcast::class,
'Bus' => Illuminate\Support\Facades\Bus::class,
'Cache' => Illuminate\Support\Facades\Cache::class,
'Config' => Illuminate\Support\Facades\Config::class,
'Cookie' => Illuminate\Support\Facades\Cookie::class,
'Crypt' => Illuminate\Support\Facades\Crypt::class,
'DB' => Illuminate\Support\Facades\DB::class,
'Eloquent' => Illuminate\Database\Eloquent\Model::class,
'Event' => Illuminate\Support\Facades\Event::class,
'File' => Illuminate\Support\Facades\File::class,
'Gate' => Illuminate\Support\Facades\Gate::class,
'Hash' => Illuminate\Support\Facades\Hash::class,
'Lang' => Illuminate\Support\Facades\Lang::class,
'Log' => Illuminate\Support\Facades\Log::class,
'Mail' => Illuminate\Support\Facades\Mail::class,
'Notification' => Illuminate\Support\Facades\Notification::class,
'Password' => Illuminate\Support\Facades\Password::class,
'Queue' => Illuminate\Support\Facades\Queue::class,
'Redirect' => Illuminate\Support\Facades\Redirect::class,
'Redis' => Illuminate\Support\Facades\Redis::class,
'Request' => Illuminate\Support\Facades\Request::class,
'Response' => Illuminate\Support\Facades\Response::class,
'Route' => Illuminate\Support\Facades\Route::class,
'Schema' => Illuminate\Support\Facades\Schema::class,
'Session' => Illuminate\Support\Facades\Session::class,
'Storage' => Illuminate\Support\Facades\Storage::class,
'URL' => Illuminate\Support\Facades\URL::class,
'Validator' => Illuminate\Support\Facades\Validator::class,
'View' => Illuminate\Support\Facades\View::class,
'Socialite' => Laravel\Socialite\Facades\Socialite::class,
'Paypal' => Netshell\Paypal\Facades\Paypal::class,
'PDF' => Barryvdh\DomPDF\Facade::class,
'Paystack' => Mehedi\Paystack\Facades\Paystack::class,
'Nexmo' => Nexmo\Laravel\Facade\Nexmo::class,
'Excel' => Maatwebsite\Excel\Facades\Excel::class,
'PaytmWallet' => Anand\LaravelPaytmWallet\Facades\PaytmWallet::class,
'Str' => Illuminate\Support\Str::class,
],
有人可以帮我吗?
【问题讨论】:
-
试试 composer require netshell/paypal --dev
-
@Bapi 实际上项目已经上线,我是这个项目的新手,错误只发生在我的系统上,所以对我来说每个人都不能改变他们的编码
-
您尝试安装的软件包支持 laravel 5,可能与 laravel 6 不兼容
-
其他人的composer.json(这里的其他人是项目的composer.json,正如你所说的项目已经在使用中)是否与你的composer.json匹配