美文网首页@IT·互联网
npm淘宝镜像报错 reason: certificate ha

npm淘宝镜像报错 reason: certificate ha

作者: small_Sun | 来源:发表于2024-03-13 10:44 被阅读0次

    我们在执行设置淘宝镜像时突然报了
    npm ERR! request to https://registry.npm.taobao.org/concurrently failed, reason: certificate has expired

    原因: 淘宝镜像原地址2024年1月22日已过期


    image.png

    解决:别担心,我们只需要将命令替换成 下面镜像即可解决

    npm config set registry https://registry.npmmirror.com 
    

    或者可以换成其他镜像也可以

    npm 官方原始镜像网址是:https://registry.npmjs.org/
    淘宝最新 NPM 镜像:https://registry.npmmirror.com
    阿里云 NPM 镜像:https://npm.aliyun.com
    腾讯云 NPM 镜像:https://mirrors.cloud.tencent.com/npm/
    华为云 NPM 镜像:https://mirrors.huaweicloud.com/repository/npm/
    网易 NPM 镜像:https://mirrors.163.com/npm/
    中科院大学开源镜像站:http://mirrors.ustc.edu.cn/
    清华大学开源镜像站:https://mirrors.tuna.tsinghua.edu.cn/
    

    如果执行完后依旧是报同样的报错,请依次执行以下两行命令

    npm cache clean --force
    npm config set strict-ssl false
    

    然后再重新安装

    npm install
    

    相关文章

      网友评论

        本文标题:npm淘宝镜像报错 reason: certificate ha

        本文链接:https://www.haomeiwen.com/subject/xdobzdtx.html