【发布时间】:2021-09-21 09:03:01
【问题描述】:
我已经尝试过all these answers,但它们都不起作用。
我也在.gitconfig 文件中配置了代理,但这是可行的,并且在 npm 中,当我尝试安装或发布包时,我收到错误;
407 Proxy Authentication Required - GET https://registry.npmjs.org/mocha
或
407 Proxy Authentication Required - PUT https://registry.npmjs.org/my-packaje
.npmrc 文件:
proxy=http://user:password@proxy:8080/
【问题讨论】:
-
您是否尝试将
https-proxy=http://user:password@proxy:8080/也添加到.npmrc? -
另外,编辑后请关闭当前终端会话并打开一个新的,因为新设置可能在已经运行的终端会话中不可用。
-
@MilanTenk 我都试过了,但对我不起作用
-
另一种方法是使用一个工具来处理代理身份验证。例如提琴手。
标签: node.js npm npm-install