angular7 - 输入 npm install -g @angular/cli 后出错
问题描述
C:\Users\91732>npm install -g @angular/cli npm 错误!代码 ENOTFOUND npm 错误!errno ENOTFOUND npm 错误!对 http://infynexus/nexus/repository/npm-all/ 的网络请求失败,原因:getaddrinfo ENOTFOUND infynexus npm ERR!网络 这是与网络连接有关的问题。npm 错误!网络 在大多数情况下,您使用代理服务器或网络设置错误。npm 错误!网络 npm 错误!网络 如果您在代理后面,请确保 npm ERR! 网络“代理”配置设置正确。请参阅:'npm 帮助配置'
解决方案
它看起来像一个代理问题:
首先尝试删除您的 npm 代理配置:
npm config delete proxy
尝试再次运行 npm install。
如果它仍然不起作用,您将不得不手动设置代理配置(也许您在公司)
npm config set proxy "http://username:password@proxy.company.com:port"
npm config set https-proxy "http://username:password@proxy.company.com:port"
如果上述任何更改有效,请尝试更改您的存储库 url:
npm cache clean --force
运行 npm install (即使你有任何错误)并设置新的 repo:
npm install
npm config set registry https://registry.npmjs.org/
然后再试一次
npm install -g @angular/cli
推荐阅读
- c++ - 范围内的 C++ 变量重定义
- python - 如何收集相关文章取决于Django Python中的标题
- javascript - javascript中列表的选定索引
- java - java内部catch中的异常
- c# - 带有 PushNotificationChannel 的桌面桥应用程序找不到文件“System.Runtime.WindowsRuntime”
- javascript - 加载后是否可以读取脚本或图像标签的内容?
- ssas - ssas 维度仅在使用名称值时重复
- c++ - 通用指数退避重试机制 C++11
- javascript - 在 google.visualization.data.group 中包含字符串列
- javascript - JavaScript 模态