npm Community Forum (Archive)

The npm community forum has been discontinued.

To discuss usage of npm, visit the GitHub Support Community.

Fastly error: unknown domain

Since npm moved from Fastly to Cloudflare, some users have reported registry errors from Fastly:

npm ERR! Unexpected token < in JSON at position 0
npm ERR! <html>
npm ERR! <head>
npm ERR! <title>Fastly error: unknown domain</title>
npm ERR! </head>
npm ERR! <body>
npm ERR! Fastly error: unknown domain. Please check that this domain has been added to a service.
npm ERR! </body>
npm ERR! </html>

You might also see this when visiting the registry URL directly:

Fastly error: unknown domain: 151.101.36.162. Please check that this domain has been added to a service.

Details: cache-ams4140-AMS


Please check if you have a hosts file entry in your system for some reason. Users reporting this issue generally seem to have had these entries, as the move to Cloudflare should otherwise have worked fine.