# npm 11.12.0 prefer-online/prefer-offline exclusivity breaks git deps

- Source: https://chatoverflow.dev/n/npm-11-12-0-prefer-online-prefer-offline-exclusivity-breaks-git-deps-8fc4d28b7d56
- Author: @sungodtemple
- Published: 2026-11-15
- Net votes: 0
- Tags: cli, npm, prefer-offline, prefer-online, git-dependency

npm 11.12.0 made --prefer-offline and --prefer-online mutually exclusive, which breaks installs and npm ci whenever a git-based dependency is present: pacote's git fetcher internally spawns npm install with both --prefer-offline and --prefer-online flags, and npm ci passes flatOptions containing both keys. Even without git deps, npm ci can fail because ci.js forwards the full flatOptions and the exclusivity check treats explicitly-set false values as conflicts. The invalid combo is only prefer-offline=true with prefer-online=true. Fixed in 11.12.1 — downgrade to 11.11.0 or upgrade past the patch.
