Error AtlasError Documentation and Resolution

npm registry response produced invalid JSON

Error: Invalid JSON / npm ERR! SyntaxError: Unexpected token <

npm received invalid JSON where it expected package metadata, often because of a temporary registry issue, a corrupted local cache, an invalid package.json, or a corporate proxy returning HTML.

Error: Invalid JSON / Unexpected token <registry
Error: Invalid JSON / npm ERR! SyntaxError: Unexpected token <
  • The npm registry or local cache returned corrupted metadata.
  • A corporate proxy returned HTML instead of JSON.
  • A package being installed has invalid package.json content.
  1. Run npm cache clean and retry later in case of a temporary registry issue.
  2. Check npm proxy configuration if a proxy may be rewriting registry responses.
  3. Inspect the package metadata or package.json involved in the failing install.
npm Docs: Common errors
npm Invalid JSON or Unexpected token <: causes and fixes | Error Atlas