When executing the command: composer install, an error is reported: script google\task\composer::cleanup handling the pre-autoload-dump event terminated with an Exception
1. When executing the command: composer install, an error is reported: script google\task\composer::cleanup handling the pre-autoload-dump event terminated with an exception. as shown in Figure 1
/object # composer install
Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform.
Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. It is recommended that you run `composer update` or `composer update `.
Package operations: 1 install, 0 updates, 0 removals
- Installing google/apiclient-services (v0.226.0): Extracting archive
Package fzaninotto/faker is abandoned, you should avoid using it. No replacement was suggested.
Package swiftmailer/swiftmailer is abandoned, you should avoid using it. Use symfony/mailer instead.
Package moontoast/math is abandoned, you should avoid using it. Use brick/math instead.
Package phpunit/php-token-stream is abandoned, you should avoid using it. No replacement was suggested.
Generating optimized autoload files
> Google\Task\Composer::cleanup
Removing 209 google services
Script Google\Task\Composer::cleanup handling the pre-autoload-dump event terminated with an exception
[Symfony\Component\Filesystem\Exception\IOException]
Failed to remove directory "/object/vendor/google/apiclient-services/src/Assuredworkloads": rmdir(/object/vendor/google/apiclient-services/src/Assuredworkloads): Directory not empty.
install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-suggest] [--no-dev] [--no-autoloader] [--no-scripts] [--no-progress] [--no-install] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--apcu-autoloader-prefix APCU-AUTOLOADER-PREFIX] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--] []...
2. Check /vendor/google/apiclient/readme.md, clean up unused services, there are more than 200 Google API services. Chances are you won’t want them all. To avoid transferring these dependencies in your code, you can run `Google\Task\Composer::CleanUp` task and specify the service you want to keep in `Composer.json` :
{
"require": {
"google/apiclient": "^2.12.1"
},
"scripts": {
"pre-autoload-dump": "Google\\Task\\Composer::cleanup"
},
"extra": {
"google/apiclient-services": [
"Drive",
"YouTube"
]
}
}
3. Edit composer.json, and decide to delete in scripts: “pre-autoload-dump”: “Google\\Task\\Composer::Cleanup” . as shown in Figure 2
"scripts": {
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"@php artisan package:discover --ansi"
],
"post-root-package-install": [
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"@php artisan key:generate --ansi"
],
"lint": "phpcs --standard=PSR1,PSR2,./ruleset.xml --ignore=config/us-zipcode.php app/ routes/ config/ ",
"lint-fix": "phpcbf --standard=PSR1,PSR2 --ignore=config/us-zipcode.php app/ routes/ config/ "
}
4. When executing the Composer Update, an error will no longer be reported. However, this is executed in the container, and later on the local Windows host does not exist. as shown in Figure 3


