diff --git a/src/Composer/Installer.php b/src/Composer/Installer.php index 0586e261c..7b1f893ae 100644 --- a/src/Composer/Installer.php +++ b/src/Composer/Installer.php @@ -360,8 +360,17 @@ class Installer $lockedRepository = null; - if ($this->locker->isLocked()) { - $lockedRepository = $this->locker->getLockedRepository(true); + try { + if ($this->locker->isLocked()) { + $lockedRepository = $this->locker->getLockedRepository(true); + } + } catch (\Seld\JsonLint\ParsingException $e) { + if ($this->updateAllowList || $this->updateMirrors) { + // in case we are doing a partial update or updating mirrors, the lock file is needed so we error + throw $e; + } + // otherwise, ignoring parse errors as the lock file will be regenerated from scratch when + // doing a full update } if ($this->updateAllowList) {