Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
When both prefer-offline=true and prefer-online=true are set in the .npmrc configuration, npm silently prioritizes prefer-offline. Commands that query the registry, such as npm view version, skip the network request entirely and return stale cached data. The CLI provides no warning or error message indicating that these mutually exclusive flags are conflicting or that prefer-online is being ignored.
Expected Behavior
npm should detect when mutually exclusive flags like prefer-offline and prefer-online are active simultaneously. It should either output a clear warning message to the console (e.g., WARN config: mutually exclusive flags prefer-offline and prefer-online detected) so the user is aware of the conflict, or ensure that explicitly setting prefer-online overrides the offline preference to force a network validation.
Steps To Reproduce
No response
Environment
No response