【问题标题】:Getting error while installing node modules inside Angular app [closed]在Angular应用程序中安装节点模块时出错[关闭]
【发布时间】:2020-10-21 19:16:43
【问题描述】:

我有一个 Angular 应用程序。当我通过运行命令npm i --save 安装node modules 时出现以下错误。

错误:

npm ERR! code ENOTFOUND
npm ERR! errno ENOTFOUND
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.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly. See: 'npm help config'

我在这里使用node version 10.xangular version 7.3.6。当我尝试运行命令npm i --save 时,也会出现这些错误node_module 文件夹为空。请帮我解决这个错误。

【问题讨论】:

    标签: node.js angular npm


    【解决方案1】:

    确保您的 .npmrc 文件具有此配置:

    registry=https://registry.npmjs.org
    always-auth=false
    strict-ssl=false
    

    使用以下命令设置注册表:

    npm config set registry https://registry.npmjs.org/
    

    如果您使用代理访问网络,那么您还必须配置 npm 才能使用它:

    npm config set proxy http://username:password@proxyname:8080 
    npm config set https-proxy http://username:password@proxyname:8080
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-11-09
      • 1970-01-01
      • 2018-07-08
      • 2020-06-27
      • 2016-12-25
      • 1970-01-01
      • 1970-01-01
      • 2015-10-24
      相关资源
      最近更新 更多