【问题标题】:ECONNRESET while installing Angular CLI with npm使用 npm 安装 Angular CLI 时的 ECONNRESET
【发布时间】:2018-05-11 16:11:53
【问题描述】:

尝试在没有代理集和完美互联网的机器上安装 Angular CLI 时,我收到以下错误:

4727 silly extract micromatch@^3.1.4 extracted to C:\Users\User\AppData
\Roaming\npm\node_modules\.staging\micromatch-7d604bf4 (38763ms)
4728 timing action:extract Completed in 265532ms
4729 verbose unlock done using C:\Users\User\AppData\Roaming\npm-cache\_locks\staging-eb8de851d6fef93d.lock for C:\Users\User\AppData\Roaming\npm\node_modules\.staging
4730 timing stage:rollbackFailedOptional Completed in 0ms
4731 timing stage:runTopLevelLifecycles Completed in 277531ms
4732 verbose type system
4733 verbose stack FetchError: request to https://registry.npmjs.org/mime-types/-/mime-types-2.1.18.tgz failed, reason: read ECONNRESET
4733 verbose stack     at ClientRequest.req.on.err 
[...]
4739 error code ECONNRESET
4740 error errno ECONNRESET
4741 error network request to https://registry.npmjs.org/mime-types/-/mime-types-2.1.18.tgz failed, reason: read ECONNRESET
4742 error network This is a problem related to network connectivity.
4742 error network In most cases you are behind a proxy or have bad network settings.
4742 error network
4742 error network If you are behind a proxy, please make sure that the
4742 error network 'proxy' config is set properly.  See: 'npm help config'
4743 verbose exit [ 1, true ]

提取 rxjs 包通常会失败。到目前为止,我已经尝试过:

  • 将注册表设置为 http:// 版本,但随后每次在 is-number 包上都会失败
  • 重新安装和更新 npm/node
  • 每次操作后清除缓存
  • 禁用 Windows 防火墙
  • 以管理员权限启动命令行
  • 检查代理配置是否为空

似乎没有任何效果。你有什么想法吗?

编辑:也许这会有所帮助,但是当我尝试更新 npm 本身时,它会在 rollbackFailedOptional 上立即挂起,它只有在将注册表更改为 http:// 版本后才设法更新自己

【问题讨论】:

  • 当我在浏览器中访问 https://registry.npmjs.org/mime-types/-/mime-types-2.1.18.tgz 时,它按预期工作
  • 你的npm是什么版本的?
  • npm 6.0.1,节点 10.1.0
  • 您可以尝试回滚到较早的 npm 版本,例如 5.6.0 并重试吗?
  • 还是一样。我也会尝试降级节点。

标签: javascript angular npm cmd npm-install


【解决方案1】:

降级为更稳定的 node/npm 版本。 要安装特定版本的 npm,例如 5.6.0

npm install -g npm@5.6.0

【讨论】:

  • 我的意思是,这是节点的问题,而不是 npm 本身,似乎是降级的节点解决了它。
  • 我明白了。我在答案中提到了降级_node_/npm。你认为我需要更清楚@MichałSadowski 吗?
  • 不,不,我现在可能太仓促了。无论如何,谢谢!
猜你喜欢
  • 2022-12-14
  • 2017-12-21
  • 2018-11-10
  • 1970-01-01
  • 2018-05-20
  • 2023-03-28
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多