首页 > 解决方案 > npm 审核失败,套接字挂起 (ECONNRESET) (WSL)

问题描述

关于如何让“npm audit”在适用于 Linux 的 Windows 子系统 (WSL) 中工作的任何想法?运行命令“npm audit”会导致错误消息“失败,原因:socker hang up”。

从 Windows 10 WSL2 下的全新 Ubuntu 18.04 LTS 安装开始,我可以使用以下命令登录并重现错误:

结果错误:

npm 错误!代码 ECONNRESET npm 错误!errno ECONNRESET npm 错误!对https://registry.npmjs.org/-/npm/v1/security/audits的网络请求失败,原因:套接字挂起

我为解决问题所做的事情:

有关进一步的故障排除步骤或可能的修复的任何想法?到目前为止,我已经用谷歌搜索并尝试了所有可能的解决方案,但没有运气。

先感谢您!

标签: node.jsnpm

解决方案


In case this helps someone else... WSL2 has a minimum build requirement of Windows 10 version 1909 (build 10.0.18363), but the command "npm audit" did not work on this version. Upgrading Windows 10 to version 2004 resolved the problem.


推荐阅读