简体   繁体   English

我无法安装“ angular / cli”软件包。 npm返回错误:主机名\\ IP与证书替代名称不匹配

[英]i cannot install 'angular/cli' package. the npm returns an error:Hostname\IP doesnt match certificate altnames

**Here is the code **I'm on an institutional wifi network**** **这里是代码**我在机构无线网络中****

C:\Windows\system32>npm install -g angular-cli
npm ERR! Windows_NT 6.2.9200
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\
node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "angular-cli"
npm ERR! node v6.11.1
npm ERR! npm  v3.10.10

npm ERR! Hostname/IP doesn't match certificate's altnames: "Host: registry.npmjs
.org. is not in the cert's altnames: DNS:*.uonbi.ac.ke"
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Windows\system32\npm-debug.log

I found out this is actually a network connectivity error. 我发现这实际上是网络连接错误。 This is a problem faced when you are behind a corporate web proxy. 当您使用公司Web代理时,这是一个问题。 Open an command prompt or terminal session and run the following commands to configure npm to work with your web proxy. 打开命令提示符或终端会话,然后运行以下命令以将npm配置为与Web代理一起使用。 The commands use proxy.company.com as the address and 8080 as the port. 这些命令使用proxy.company.com作为地址,并使用8080作为端口。

npm config set proxy http://proxy.company.com:8080 npm config set https-proxy http://proxy.company.com:8080 npm config设置代理http://proxy.company.com:8080 npm config设置https-proxy http://proxy.company.com:8080

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

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