asxez / DDCS

Docker汉化脚本 DockerDesktop汉化脚本 Docker汉化 Docker Windows Docker MAC
GNU General Public License v3.0
38 stars 6 forks source link

npm ERR! request to https://registry.npm.taobao.org/asar failed, reason: certificate has expired #5

Closed huang1125677925 closed 2 weeks ago

huang1125677925 commented 3 weeks ago

这个错误通常是由于 npm 在尝试访问指定的注册表时遇到了 SSL 证书过期的问题。以下是一些解决此问题的步骤:

  1. 切换到官方 npm 注册表: 如果你使用的是淘宝镜像,可以尝试切换回官方的 npm 注册表。运行以下命令:

    npm config set registry https://registry.npmjs.org/
  2. 更新 npm: 确保你使用的是最新版本的 npm。你可以通过以下命令更新 npm:

    npm install -g npm
  3. 检查系统时间: 确保你的系统时间和日期是正确的。错误的系统时间可能导致 SSL 证书验证失败。

  4. 使用 HTTP 协议: 如果你只是想临时解决问题,可以尝试使用 HTTP 协议(不推荐用于生产环境):

    npm config set registry http://registry.npm.taobao.org/
  5. 清除 npm 缓存: 有时,清除 npm 缓存可以解决问题:

    npm cache clean --force
  6. 检查网络问题: 确保你的网络连接正常,有时网络问题也会导致无法访问注册表。

  7. 使用其他镜像: 如果问题仍然存在,可以考虑使用其他的 npm 镜像,例如 cnpm:

    npm install -g cnpm --registry=https://registry.npm.taobao.org

如果以上方法都无法解决问题,建议查看 npm 的 GitHub 问题页面或社区论坛,看看是否有其他用户遇到类似问题并找到了解决方案。

asxez commented 3 weeks ago

淘宝镜像已经于2021年换新镜像域名了,使用 https://registry.npmmirror.com 即可