于北斋 2022-05-19 14:59 采纳率: 0%
浏览 207
已结题

cnpm 任何东西下载报错,之前不会报错

问题遇到的现象和发生背景

下载安装mockjs
cnpm install --save mockjs或者cnpm install -g webpack等等

问题相关代码,请勿粘贴截图
运行结果及报错内容

Get /binary-mirror-config/latest from https://registry.npmmirror.com/ error: Error: unable to verify the first certificate at TLSSocket.onConnectSecure (node:_tls_wrap:1530:34)
at TLSSocket.emit (node:events:390:28)
at TLSSocket._finishInit (node:_tls_wrap:944:8)
at TLSWrap.ssl.onhandshakedone (node:_tls_wrap:725:12)
Get /bug-versions/latest from https://registry.npmmirror.com/ error: Error: unable to verify the first certificate
at TLSSocket.onConnectSecure (node:_tls_wrap:1530:34)
at TLSSocket.emit (node:events:390:28)
at TLSSocket._finishInit (node:_tls_wrap:944:8)
at TLSWrap.ssl.onhandshakedone (node:_tls_wrap:725:12)
Error: Cannot find module 'bug-versions/package.json'

我的解答思路和尝试过的方法

网上很多方法都尝试了,没有用,重新换源,都没用

我想要达到的结果

成功下载

  • 写回答

5条回答 默认 最新

  • coderFY 2022-05-19 15:43
    关注

    建议直接修改npm的镜像,和cnpm效果一样,或者使用yarn

    npm set registry https://registry.npm.taobao.org/
    

    看你的报错应该是连接cnpm镜像时网络不佳

    评论 编辑记录

报告相同问题?

问题事件

  • 系统已结题 5月27日
  • 创建了问题 5月19日