<p>今天使用npm安装一直报错,显示证书过期</p>
讯享网
方案一:切换npm源(亲测无用)
# 1. 安装 nrm
npm install -g nrm
#2.查看
nrm ls
npm ———- https://registry.npmjs.org/
yarn ——— https://registry.yarnpkg.com/
tencent —— https://mirrors.cloud.tencent.com/npm/
cnpm ——— https://r.cnpmjs.org/
taobao ——- https://registry.npmmirror.com/
npmMirror —- https://skimdb.npmjs.com/registry/
huawei ——- https://repo.huaweicloud.com/repository/npm/#3.切换
nrm use taobao
方案二:检查日期,清理缓存(无效)

输入date查看当前系统时间:
date
输入以下命令来清除npm的缓存:npm cache clean –force或npm cache verify
方案三:取消ssl验证(不要轻易使用,不过有效😂)
因为这种方式会使您的连接不安全,请谨慎。
npm config set strict-ssl false
注意:#安装成功后请立即开启:npm config set strict-ssl true


版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容,请联系我们,一经查实,本站将立刻删除。
如需转载请保留出处:https://51itzy.com/kjqy/146777.html