【问题标题】:Why i am getting this error while installing angular cli?为什么在安装 Angular cli 时出现此错误?
【发布时间】:2018-09-01 23:56:20
【问题描述】:

我输入了以下几行:

C:\Users\Surendra>node -v
v8.11.4

C:\Users\Surendra>npm -v
5.6.0

C:\Users\Surendra>npm install -g @angular/cli

我收到以下错误:

npm ERR! request to https://registry.npmjs.org/@angular%2fcli failed, reason: Hostname/IP doesn't match certificate's altnames: "Host: registry.npmjs.org. is not in the cert's altnames: DNS:a.sni.fastly.net, DNS:a.sni.global-ssl.fastly.net"

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Surendra\AppData\Roaming\npm-cache\_logs\2018-09-01T15_14_45_954Z-debug.log

【问题讨论】:

    标签: npm installation angular-cli


    【解决方案1】:

    run npm cache clean --forcenpm install npm -g

    之后尝试运行npm config set strict-ssl false

    如果不起作用,请尝试运行npm config set registry "http://registry.npmjs.org"

    编辑:

    涉及 DNS 错误配置的早期中断导致某些 ISP 缓存 npmjs.com 丢失,解决方法是使用第三方 DNS 提供商,例如 Cloudflare 或 Google,受影响的缓存应在接下来的 24 小时内清除.

    https://status.npmjs.org/incidents/v22ffls5cd6h

    【讨论】:

    • 好的..但是我今天已经从nodejs的互联网上下载了最新版本,它显示的是5.6.0 ..我不认为它是旧的..让我试试你分享的命令.
    • 是的,它可以工作.. 最新版本的 npm 显示为 6.4.1,非常感谢。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2023-03-29
    • 1970-01-01
    • 2021-04-27
    • 2014-03-03
    • 1970-01-01
    • 1970-01-01
    • 2017-04-16
    相关资源
    最近更新 更多