/errors/poetry/no-dev-option-does-not-exist
Poetry: The option "--no-dev" does not exist
- tool
- Poetry
- exit code
- 1
- versions
- Poetry 2.x
- os
- any
The option "--no-dev" does not exist means the installed Poetry is 2.x, where the --no-dev flag no longer exists. Since Poetry 1.2, development dependencies live in dependency groups; --no-dev was deprecated then and Poetry 2 no longer accepts it. Replace poetry install --no-dev with poetry install --without dev (skip the dev group) or poetry install --only main (main dependencies only).
Reproduce it
cat > pyproject.toml <<'EOF'
[project]
name = "demo"
version = "0.1.0"
requires-python = ">=3.10"
dependencies = []
[tool.poetry]
package-mode = false
EOF
uvx -q poetry@2.5.1 config virtualenvs.in-project true --local
uvx -q poetry@2.5.1 install --no-devOutput · exit 1
Creating virtualenv demo in /tmp/work/.venv The option "--no-dev" does not exist
Poetry rejects the option before it resolves or installs anything.
Fix
cat > pyproject.toml <<'EOF'
[project]
name = "demo"
version = "0.1.0"
requires-python = ">=3.10"
dependencies = []
[tool.poetry]
package-mode = false
[tool.poetry.group.dev.dependencies]
six = "1.16.0"
EOF
uvx -q poetry@2.5.1 config virtualenvs.in-project true --local
uvx -q poetry@2.5.1 install --without devOutput
Creating virtualenv demo in /tmp/work/.venv Updating dependencies Resolving dependencies... Writing lock file
The group passed to --without must exist: Poetry 2 stops with Group(s) not found: dev (via --without) when pyproject.toml has no dev group, so drop the option for projects without dev dependencies.
| Poetry 1.x | Poetry 2.x |
|---|---|
| poetry install --no-dev | poetry install --without dev |
| poetry install --no-dev (main only, no other groups) | poetry install --only main |
--without dev still installs any other non-optional group (for example a test group); --only main installs nothing but the main dependencies. poetry add -D PKG is still accepted in Poetry 2 as a shortcut for --group dev.