Closed mcgrews3 closed 6 years ago
Example: OUT - [2018-05-28T23:20:28.183+0000] "GET /tweetnacl HTTP/1.1" 404 0 19 "install" "npm/3.10.10 node/v6.10.2 win32 x64"
Thought I saw an HTTP Status code of 418 in there too, but cant find it in the logs.
I believe our proxy is getting an HTTP 418 - and is just turning it into an HTTP 404.
What is HTTP 418 Teapot used for?
The body of the 418 is {"error":"got unknown host (registry.npmjs.org:443)"}
. Looks like some npm clients are appending the port to the Host header, but only when going through a proxy, and that's confusing the registry:
$ wget --header='Host: registry.npmjs.org:443' https://registry.npmjs.org/
--2018-05-29 01:22:08-- https://registry.npmjs.org/
Resolving registry.npmjs.org (registry.npmjs.org)... 104.18.95.96, 104.18.97.96, 104.18.94.96, ...
Connecting to registry.npmjs.org (registry.npmjs.org)|104.18.95.96|:443... connected.
HTTP request sent, awaiting response... 418 I'm a teapot
2018-05-29 01:22:08 ERROR 418: I'm a teapot.
It's perfectly legal for the Host header to include the default port, so the registry is in the wrong here.
Would it kill them to give a helpful error instead of making a joke? Wasted a good chunk of the the morning reading posts about April Fool's jokes and memes from 1998 when I just wanted to know how to fix the problem.
looks like solved....
Working now.
Still not working. Not fixed. Using yarn seems like the best option.
Still facing this issue :/
same here, facing the issue right now.
still facing the issue since morning.
And now it works. 👍
Still not working for me :/
SOLVED : I solved the problem by editing the registry to https : npm config set registry https://registry.npmjs.org/
npm config set registry https://registry.npmjs.org/ solved the issue.. Thank you @predzme
@predzme npm config set registry solved the issue for me
We use a proxy to connect to the NPM registry - when using
npm install
all packages are returning HTTP 418 on the proxy and the npm client is returning not found.