I don't understand how this happened. Why would a client appending the port in the Host: header result in the server giving that reply? Is it a default joke reply if the npm repository server is confused?
Most likely it was the server being very confused and not understanding that you could put the port in the Host header (very legit thing to do and proxies do it a lot)