diff --git a/src/poetry/installation/installer.py b/src/poetry/installation/installer.py index 12d54f3c567..21230da6988 100644 --- a/src/poetry/installation/installer.py +++ b/src/poetry/installation/installer.py @@ -245,12 +245,12 @@ def _do_install(self) -> int: locked_repository = self._locker.locked_repository() if not self._locker.is_fresh(): - self._io.write_error_line( - "" - "Warning: poetry.lock is not consistent with pyproject.toml. " + raise ValueError( + "" + "Error: poetry.lock is not consistent with pyproject.toml. " "You may be getting improper dependencies. " "Run `poetry lock [--no-update]` to fix it." - "" + "" ) locker_extras = {