Closed Einenlum closed 5 years ago
Hmm, interesting: never thought of the use-case of composer dump-autoload
without composer install
.
Would you consider sending a patch stating that composer install
is required first?
Doing a composer install
before does not solve the problem because composer install
does not work either :/.
➜ login composer install -vvv
Reading ./composer.json
Loading config file ./composer.json
Checked CA file /etc/ca-certificates/extracted/tls-ca-bundle.pem: valid
Executing command (/tmp/login): git branch --no-color --no-abbrev -v
Executing command (/tmp/login): git describe --exact-match --tags
Executing command (/tmp/login): git log --pretty="%H" -n1 HEAD
Executing command (/tmp/login): hg branch
Executing command (/tmp/login): fossil branch list
Executing command (/tmp/login): fossil tag list
Executing command (/tmp/login): svn info --xml
Reading /home/einenlum/.config/composer/composer.json
Loading config file /home/einenlum/.config/composer/composer.json
Reading /tmp/login/vendor/composer/installed.json
Reading /home/einenlum/.config/composer/vendor/composer/installed.json
Loading plugin PackageVersions\Installer
Running 1.8.6 (2019-06-11 15:03:05) with PHP 7.3.7 on Linux / 5.1.19-1-MANJARO
Loading composer repositories with package information
Downloading https://repo.packagist.org/packages.json
Writing /home/einenlum/.cache/composer/repo/https---repo.packagist.org/packages.json into cache
Updating dependencies (including require-dev)
Reading /home/einenlum/.cache/composer/repo/https---repo.packagist.org/p-provider-2013.json from cache
Reading /home/einenlum/.cache/composer/repo/https---repo.packagist.org/p-provider-2014.json from cache
Reading /home/einenlum/.cache/composer/repo/https---repo.packagist.org/p-provider-2015.json from cache
Reading /home/einenlum/.cache/composer/repo/https---repo.packagist.org/p-provider-2016.json from cache
Reading /home/einenlum/.cache/composer/repo/https---repo.packagist.org/p-provider-2017.json from cache
Reading /home/einenlum/.cache/composer/repo/https---repo.packagist.org/p-provider-2018.json from cache
Reading /home/einenlum/.cache/composer/repo/https---repo.packagist.org/p-provider-2018-10.json from cache
Reading /home/einenlum/.cache/composer/repo/https---repo.packagist.org/p-provider-2019-01.json from cache
Reading /home/einenlum/.cache/composer/repo/https---repo.packagist.org/p-provider-2019-04.json from cache
Reading /home/einenlum/.cache/composer/repo/https---repo.packagist.org/p-provider-2019-07.json from cache
Reading /home/einenlum/.cache/composer/repo/https---repo.packagist.org/p-provider-archived.json from cache
Reading /home/einenlum/.cache/composer/repo/https---repo.packagist.org/p-provider-latest.json from cache
Resolving dependencies through SAT
Looking at all rules.
Dependency resolution completed in 0.000 seconds
Analyzed 48 packages to resolve dependencies
Analyzed 48 rules to resolve dependencies
Nothing to install or update
Reading /tmp/login/vendor/composer/installed.json
Generating autoload files
[LogicException]
No lockfile found. Unable to read locked packages
Exception trace:
() at phar:///usr/local/bin/composer/src/Composer/Package/Locker.php:266
Composer\Package\Locker->getLockData() at /home/einenlum/.config/composer/vendor/ocramius/package-versions/src/PackageVersions/Installer.php:188
PackageVersions\Installer::getVersions() at n/a:n/a
iterator_to_array() at /home/einenlum/.config/composer/vendor/ocramius/package-versions/src/PackageVersions/Installer.php:106
PackageVersions\Installer::dumpVersionsClass() at n/a:n/a
call_user_func() at phar:///usr/local/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php:176
Composer\EventDispatcher\EventDispatcher->doDispatch() at phar:///usr/local/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php:96
Composer\EventDispatcher\EventDispatcher->dispatchScript() at phar:///usr/local/bin/composer/src/Composer/Autoload/AutoloadGenerator.php:312
Composer\Autoload\AutoloadGenerator->dump() at phar:///usr/local/bin/composer/src/Composer/Installer.php:304
Composer\Installer->run() at phar:///usr/local/bin/composer/src/Composer/Command/InstallCommand.php:122
Composer\Command\InstallCommand->execute() at phar:///usr/local/bin/composer/vendor/symfony/console/Command/Command.php:245
Symfony\Component\Console\Command\Command->run() at phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:835
Symfony\Component\Console\Application->doRunCommand() at phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:185
Symfony\Component\Console\Application->doRun() at phar:///usr/local/bin/composer/src/Composer/Console/Application.php:258
Composer\Console\Application->doRun() at phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:117
Symfony\Component\Console\Application->run() at phar:///usr/local/bin/composer/src/Composer/Console/Application.php:104
Composer\Console\Application->run() at phar:///usr/local/bin/composer/bin/composer:61
require() at /usr/local/bin/composer:24
install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--no-suggest] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--ignore-platform-reqs] [--] [<packages>]...
Yeah, but why is that autoload generator being started before composer.lock
is there?
I have no clue.
I suggest dropping your ~/.config/composer
and seeing if an old dependency in there is causing this.
Overall to be avoided: composer global
Thanks, it works when deleting my .config/composer
dir.
For the record, previous global composer.json and composer.lock:
{
"require": {
"laravel/lumen-installer": "^1.1",
"vimeo/psalm": "^3.4"
}
}
Same thing happens when running a composer install
with a composer.json
that has no dependencies (cross-linking the https://github.com/composer/composer/issues/8336 issue)
This scenario should be caught I guess, as it breaks basic workings of Composer: With an "empty" composer.json
, Composer should create a vendor
folder and a composer.lock
file. With ocramius/package-versions
globally installed (as a dependency of – for example – symfony/console
) this behavior breaks.
Hi. When I init a composer project with no dependencies and try to dump-autoload, I get this error and it seems it's involving this package:
Here is the composer.json:
Details about the installed version of
ocramius/package-versions
:Creating this issue after this one was closed in the
composer/composer
repository.