npm Expected JSON. The Proxy Sent an HTML Page.
A registry parse failure can be the visible result of a proxy login or error page. Inspect the response before replacing package metadata or clearing caches.
An npm error mentioning unexpected HTML is worth reading literally. The response may be a proxy login page, not a corrupt package.
Check the status, content type, and a redacted beginning of the response. A 407 identifies a proxy authentication challenge. A branded HTML access-denied page can also reveal an intermediary even when the visible error focuses on JSON parsing.
Confirm the configured registry as well as the selected proxy. They are different addresses: npm asks the registry for package data and can use a proxy to carry that request.
Fix the route or authentication stage producing the page. Clearing the package cache cannot turn a rejected request into an authorized one. Likewise, disabling TLS verification does not supply a missing proxy account.
Keep the original diagnostic text after redacting credentials. “Unexpected token” is less useful than the HTTP response that explains why the expected registry data never arrived.