【问题标题】:Error when trying to install Angular Cli or update current Node.js Version尝试安装 Angular Cli 或更新当前 Node.js 版本时出错
【发布时间】:2019-10-04 07:03:01
【问题描述】:

我是角度新手。所以为了学习角度我尝试安装它。但它给了我以下错误

我也尝试更新我的节点。但这也失败了。

我使用了以下命令...... npm install npm -g(用于 npm 更新) npm install -g @angular/cli(用于 Angular 更新)

我现在的node版本是8,操作系统是Win10。

错误是

npm ERR! errno ENOTFOUND
npm ERR! network request to https://registry.npmjs.org/@angular%2fcli failed, reason: getaddrinfo ENOTFOUND registry.npmjs.org 
registry.npmjs.org:443
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.

【问题讨论】:

  • 您是在公司电脑上安装它吗?可能是代理问题?

标签: node.js angular angular-cli


【解决方案1】:

检查您的配置设置:npm config list

然后您可以添加或更改您的代理设置:

npm config set http-proxy http://your_proxy_ip:port
npm config set https-proxy http://your_proxy_ip:port

答案来自这里:https://github.com/npm/npm/issues/17947

【讨论】:

    【解决方案2】:

    请参考这个网站,besthostadvisor.com/blog/how-to-update-node-js/它包括所有更新节点的方法

    【讨论】:

      【解决方案3】:

      我在使用 npm 6.0.9 时遇到了这个问题,我这样做了: 我将 npm install -g @angular/cli 与 powershell 一起使用 这是正常运行的。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2017-10-27
        • 2022-06-15
        • 1970-01-01
        • 2021-07-01
        • 1970-01-01
        • 2021-05-29
        • 1970-01-01
        相关资源
        最近更新 更多