搜到一个可能有用的信息。我这个代理在其它还没升级到 24.04 的服务器上没问提。看来 24.04 的 ubuntu 或者新版本的 npm 升级了验证体系?
The dreaded NTLM
There is an HTTP status code 407 (proxy authentication required), which is the more correct way of saying it's the proxy rather than the destination server that's rejecting your request. That code plagued me for the longest time until after a lot of time on Google, I learned my proxy used NTLM authentication. HTTP basic authentication wasn't enough to satisfy whatever proxy my corporate overlords had installed. I resorted to using Cntlm on my local machine (unauthenticated), then had it handle the NTLM authentication with the upstream proxy. Then I had to tell all the programs that couldn't do NTLM to use my local machine as the proxy - which is generally as simple as setting HTTP_PROXY and HTTPS_PROXY. Otherwise, for npm use (as @
Agus suggests):
npm config set proxy
http://proxy.example.com:3128npm config set https-proxy
http://proxy.example.com:3128