statamic-rad-pack / mailchimp

Mailchimp integration for Statamic
https://statamic.com/addons/rad-pack/mailchimp
MIT License
18 stars 12 forks source link

bug: unable to install add-on #47

Closed lukeagsmith closed 3 years ago

lukeagsmith commented 3 years ago

running composer require silentz/mailchimp gives the error:

> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi
PHP Fatal error:  Access level to Edalzell\Mailchimp\ServiceProvider::bootConfig() must be protected (as in class Statamic\Providers\AddonServiceProvider) or weaker in /Users/luke/sites/domain.com/vendor/silentz/mailchimp/src/ServiceProvider.php on line 56

In ServiceProvider.php line 56:

  Access level to Edalzell\Mailchimp\ServiceProvider::bootConfig() must be pr  
  otected (as in class Statamic\Providers\AddonServiceProvider) or weaker      

Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 255

Installation failed, reverting ./composer.json to its original content.

This error still happens after running:

rm -rf vendor composer.lock
composer clear-cache
composer install
edalzell commented 3 years ago

What version is it trying to install? The current version doesn't have that method at all?

lukeagsmith commented 3 years ago

Version 2.0.4

composer require silentz/mailchimp
Using version ^2.0 for silentz/mailchimp
./composer.json has been updated
Running composer update silentz/mailchimp
Loading composer repositories with package information
Updating dependencies
Lock file operations: 3 installs, 0 updates, 0 removals
  - Locking drewm/mailchimp-api (v2.5.4)
  - Locking silentz/mailchimp (2.0.4)
  - Locking spatie/laravel-newsletter (4.8.2)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 3 installs, 0 updates, 0 removals
  - Downloading drewm/mailchimp-api (v2.5.4)
  - Downloading spatie/laravel-newsletter (4.8.2)
  - Downloading silentz/mailchimp (2.0.4)
  - Installing drewm/mailchimp-api (v2.5.4): Extracting archive
  - Installing spatie/laravel-newsletter (4.8.2): Extracting archive
  - Installing silentz/mailchimp (2.0.4): Extracting archive
edalzell commented 3 years ago

Huh, interesting. My guess is that you are not on PHP7.4 as 2.0.5 was the first version to require that.

Can you do it manually to confirm? Set the constraint to "silentz/mailchimp": "^2.2" in your composer.json then run composer update?

lukeagsmith commented 3 years ago

Yes I think you are right:

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - silentz/mailchimp[v2.2, ..., v2.2.4] require php ^7.4 -> your php version (7.3.10) does not satisfy that requirement.
    - Root composer.json requires silentz/mailchimp ^2.2 -> satisfiable by silentz/mailchimp[v2.2, ..., v2.2.4].
edalzell commented 3 years ago

Upgrade to php 7.4 and you should be good to go!