When you remove vendor/ (to clean up) then composer install will fail because it doesnt check for this edge case.
benny@benny-desktop:~/code/php/wsnetbeans/DoctrineBundle(master)$ composer install
Installing from lock file
PHP Notice: Undefined index: hash in phar:///home/benny/code/php/composer.phar/src/Composer/Package/Locker.php on line 2
PHP Stack trace:
PHP 1. {main}() /home/benny/code/php/composer.phar:0
PHP 2. require() /home/benny/code/php/composer.phar:15
PHP 3. Composer\Console\Application->run() phar:///home/benny/code/php/composer.phar/bin/composer:14
PHP 4. Symfony\Component\Console\Application->run() phar:///home/benny/code/php/composer.phar/src/Composer/Console/Application.php:2
PHP 5. Composer\Console\Application->doRun() phar:///home/benny/code/php/composer.phar/vendor/symfony/console/Symfony/Component/Console/Application.php:2
PHP 6. Symfony\Component\Console\Application->doRun() phar:///home/benny/code/php/composer.phar/src/Composer/Console/Application.php:2
PHP 7. Symfony\Component\Console\Command\Command->run() phar:///home/benny/code/php/composer.phar/vendor/symfony/console/Symfony/Component/Console/Application.php:2
PHP 8. Composer\Command\InstallCommand->execute() phar:///home/benny/code/php/composer.phar/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:2
PHP 9. Composer\Command\InstallCommand->install() phar:///home/benny/code/php/composer.phar/src/Composer/Command/InstallCommand.php:10
PHP 10. Composer\Package\Locker->isFresh() phar:///home/benny/code/php/composer.phar/src/Composer/Command/InstallCommand.php:10
Your lock file is out of sync with your composer.json, run "composer.phar update" to update dependencies
PHP Notice: Undefined index: packages in phar:///home/benny/code/php/composer.phar/src/Composer/Package/Locker.php on line 2
PHP Stack trace:
PHP 1. {main}() /home/benny/code/php/composer.phar:0
PHP 2. require() /home/benny/code/php/composer.phar:15
PHP 3. Composer\Console\Application->run() phar:///home/benny/code/php/composer.phar/bin/composer:14
PHP 4. Symfony\Component\Console\Application->run() phar:///home/benny/code/php/composer.phar/src/Composer/Console/Application.php:2
PHP 5. Composer\Console\Application->doRun() phar:///home/benny/code/php/composer.phar/vendor/symfony/console/Symfony/Component/Console/Application.php:2
PHP 6. Symfony\Component\Console\Application->doRun() phar:///home/benny/code/php/composer.phar/src/Composer/Console/Application.php:2
PHP 7. Symfony\Component\Console\Command\Command->run() phar:///home/benny/code/php/composer.phar/vendor/symfony/console/Symfony/Component/Console/Application.php:2
PHP 8. Composer\Command\InstallCommand->execute() phar:///home/benny/code/php/composer.phar/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:2
PHP 9. Composer\Command\InstallCommand->install() phar:///home/benny/code/php/composer.phar/src/Composer/Command/InstallCommand.php:10
PHP 10. Composer\Package\Locker->getLockedPackages() phar:///home/benny/code/php/composer.phar/src/Composer/Command/InstallCommand.php:10
PHP Warning: Invalid argument supplied for foreach() in phar:///home/benny/code/php/composer.phar/src/Composer/Package/Locker.php on line 2
PHP Stack trace:
PHP 1. {main}() /home/benny/code/php/composer.phar:0
PHP 2. require() /home/benny/code/php/composer.phar:15
PHP 3. Composer\Console\Application->run() phar:///home/benny/code/php/composer.phar/bin/composer:14
PHP 4. Symfony\Component\Console\Application->run() phar:///home/benny/code/php/composer.phar/src/Composer/Console/Application.php:2
PHP 5. Composer\Console\Application->doRun() phar:///home/benny/code/php/composer.phar/vendor/symfony/console/Symfony/Component/Console/Application.php:2
PHP 6. Symfony\Component\Console\Application->doRun() phar:///home/benny/code/php/composer.phar/src/Composer/Console/Application.php:2
PHP 7. Symfony\Component\Console\Command\Command->run() phar:///home/benny/code/php/composer.phar/vendor/symfony/console/Symfony/Component/Console/Application.php:2
PHP 8. Composer\Command\InstallCommand->execute() phar:///home/benny/code/php/composer.phar/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:2
PHP 9. Composer\Command\InstallCommand->install() phar:///home/benny/code/php/composer.phar/src/Composer/Command/InstallCommand.php:10
PHP 10. Composer\Package\Locker->getLockedPackages() phar:///home/benny/code/php/composer.phar/src/Composer/Command/InstallCommand.php:10
That's because your lock file is outdated (there was a BC break in format a while back) I think. Try removing it and creating a new one.
Thanks that's worked for me
Just what I needed to know. Thank you!
Most helpful comment
That's because your lock file is outdated (there was a BC break in format a while back) I think. Try removing it and creating a new one.