Composer error: Could not scan for classes inside "/home/....../Projects/untitled/vendor/woocommerce/woocommerce/vendor/league/container" which does not appear to be a file nor a folder
Full output:
$ composer --version
Composer version 1.8.6 2019-06-11 15:03:05
$ php -v
PHP 7.3.24-2+ubuntu20.04.1+deb.sury.org+1 (cli) (built: Oct 31 2020 09:56:35) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.24, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.3.24-2+ubuntu20.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies
$ composer install
Loading composer repositories with package information
Warning from https://repo.packagist.org: You are using an outdated version of Composer. Composer 2.0 is now available and you should upgrade. See https://getcomposer.org/2
Updating dependencies (including require-dev)
Package operations: 12 installs, 0 updates, 0 removals
- Installing automattic/jetpack-autoloader (v2.2.0): Loading from cache
- Installing composer/installers (v1.7.0): Loading from cache
- Installing psr/container (1.0.0): Loading from cache
- Installing league/container (3.3.3): Loading from cache
- Installing woocommerce/woocommerce-blocks (v3.6.0): Loading from cache
- Installing woocommerce/woocommerce-admin (1.6.3): Loading from cache
- Installing woocommerce/action-scheduler (3.1.6): Loading from cache
- Installing symfony/css-selector (v5.1.8): Loading from cache
- Installing pelago/emogrifier (v3.1.0): Loading from cache
- Installing maxmind-db/reader (v1.6.0): Loading from cache
- Installing automattic/jetpack-constants (v1.5.0): Loading from cache
- Installing woocommerce/woocommerce (4.7.0): Loading from cache
maxmind-db/reader suggests installing ext-bcmath (bcmath or gmp is required for decoding larger integers with the pure PHP decoder)
maxmind-db/reader suggests installing ext-gmp (bcmath or gmp is required for decoding larger integers with the pure PHP decoder)
maxmind-db/reader suggests installing ext-maxminddb (A C-based database decoder that provides significantly faster lookups)
Writing lock file
Generating autoload files
[RuntimeException]
Could not scan for classes inside "/home/....../Projects/untitled/vendor/woocommerce/woocommerce/vendor/league/container" which does not appear to be a file nor a folder
Prerequisites (mark completed items with an [x]):
Describe the bug We cannot install WC via Composer since WC 4.7.0.
Expected behavior Successful WC 4.7 Composer package installation.
Actual behavior
Composer error:
Could not scan for classes inside "/home/....../Projects/untitled/vendor/woocommerce/woocommerce/vendor/league/container" which does not appear to be a file nor a folder
Full output:
Steps to reproduce the bug
Create this
composer.json
:Run
composer install
Tested with multiple Composer 1 and PHP 7.1-7.4 versions. Local (Linux), Docker, CI.
WC 4.6 (e.g.
require
"woocommerce/woocommerce": "4.6.2"
in composer) or below works fine.