The bug did not affect all users, but only those behind a proxy server. In spite of this, many developers were impacted because most large-scale development firms usually operate behind proxies that regulate and control internal network traffic.
The reason for the bug was that some proxy servers were appending a port value to requests destined for the NPM package registry, resulting in HTTP requests that looked like registry.npmjs.org:443, instead of registry.npmjs.org.
The additional port 443 value confused the NPM registry's servers, which then triggered the 418 error code.
The NPM team fixed the issue after seven hours during which developers were both alarmed and amused by the funny error code.
The "Error 418 I'm a teapot" message is not a standard server error type. This all goes back to an April Fools' prank dating to 1998, when a group of developers jokingly proposed the Hyper Text Coffee Pot Control Protocol (HTCPCP) to the Internet Engineering Task Force (IETF), an organization that creates and manages Internet standards.
The RFC 2324 prank standard included many funny error codes, including "Error 418 I'm a teapot."
In the last two decades, the 1998 prank achieved meme status, and many development teams have implemented the "Error 418 I'm a teapot" message inside their applications as an inside joke, often using this error for bugs of unknown origins.
It's now quite apparent that the team behind the Node Package Manager (NPM) was also a fan of this meme.
UPDATE [June 1]: npm has sent over the following statement on the incident:
Image credits: Unknown. Image taken from Internet Archive and once displayed on the frontpage of the error418.net website.