# 切换 npm 源 切换至`npmmirror`镜像 ``` npm config set registry https://registry.npmmirror.com ``` # 清除 npm 缓存 强制清除 npm 的本地缓存,然后再重新安装依赖,解决因缓存导致的证书验证问题 ``` npm cache clean --force ``` # 更新 npm 将 npm 更新到最新版本,然后再尝试安装 ``` npm install -g npm ``` 切换 npm 源切换至npmmirror镜像npm config set registry https://registry.npmmirror.com清除 npm 缓存强制清除 npm 的本地缓存,然后再重新安装依赖,解决因缓存导致的证书验证问题npm cache clean --force更新 npm将 npm 更新到最新版本,然后再尝试安装npm install -g npm 最后修改:2025 年 09 月 21 日 © 允许规范转载 赞 如果觉得我的文章对你有用,请随意赞赏