简体   繁体   English

在 VPN 中安装 jquery 时出现 NPM 407 错误

[英]Getting NPM 407 error while installing jquery, in VPN

I am trying to install jquery using npm in my project, but it is giving this error : npm ERR! 407 Proxy Authentication Required - GET http://registry.npmjs.org/jquery我试图在我的项目中使用 npm 安装 jquery,但它给出了这个错误: npm ERR! 407 Proxy Authentication Required - GET http://registry.npmjs.org/jquery npm ERR! 407 Proxy Authentication Required - GET http://registry.npmjs.org/jquery . npm ERR! 407 Proxy Authentication Required - GET http://registry.npmjs.org/jquery On Googling I found out that we have to set proxy settings using commands such as npm config set proxy http://proxy.company.com:proxyport but I am using a VPN network, and in proxy settings it shows *Some properties are hidden or managed by your organization How do I resolve this problem?在谷歌搜索上,我发现我们必须使用诸如npm config set proxy http://proxy.company.com:proxyport命令来设置代理设置,但我使用的是 VPN 网络,并且在代理设置中它显示*Some properties are hidden or managed by your organization如何解决此问题?

Correct proxy setting:正确的代理设置:

HOME:File .npmrc主页:文件 .npmrc

Mac:
/Users/user_name/.npmrc
Window:
C:\Users\user_name\.npmrc

Add proxy with username and password使用用户名和密码添加代理

proxy=http://username:password@proxy_url:8080
http-proxy=http://username:password@proxy_url:8080
https-proxy=http://username:password@proxy_url:8080

Note: If your password contains special char, replace with encoded value.注意:如果您的密码包含特殊字符,请替换为编码值。 Like @ will be %40就像@ 将是 %40

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM