首页 > 其他分享 >npm报错:request to https://registry.npm.taobao.org failed, reason certificate has expired (淘宝镜像过期)

npm报错:request to https://registry.npm.taobao.org failed, reason certificate has expired (淘宝镜像过期)

时间:2024-02-27 10:58:04浏览次数:24  
标签:npm certificate 报错 registry https 淘宝 镜像 config

一、报错问题:提示淘宝镜像过期

二、错误提示已经告诉原因是淘宝镜像过期了!
其实,早在 2021 年,淘宝就发文称,npm 淘宝镜像已经从 registry.npm.taobao.org 切换到了 registry.npmmirror.com。旧域名也将于 2022 年 5 月 31 日停止服务(不过,直到今天 HTTPS 证书到期才真正不能用了)

三、解决方案
1、查看当前的npm镜像设置:npm config list

2、清空缓存:npm cache clean --force

3、然后修改镜像即可:npm config set registry https://registry.npmjs.org/ (或npm config delete registry)

!!!注意:此处修改的镜像用的是npm本身,一般国内用户还是建议使用淘宝镜像,所以推荐还是设置成用淘宝镜像,执行:npm config set registry https://registry.npmmirror.com 【推荐】
4、再次运行: npm config list,查看 registry 已经被更改为默认的 npm 公共镜像地址。

然后就可以正常使用npm啦~

转自:https://blog.csdn.net/maoge_666/article/details/136038003

标签:npm,certificate,报错,registry,https,淘宝,镜像,config
From: https://www.cnblogs.com/axingya/p/18036408

相关文章

  • 服务器安装CentOS7 报错/dev/root does not exist
    报错内容通过u盘安装实体服务器时,找不到u盘报错  解决方法在报错页面出入blkid,查看u盘盘符 在安装界面按“e”修改将  vmlinuzinitrd=initrd.imginst.stage2=hd:LABEL=CentOS\xxxxquiet修改为vmlinuzinitrd=initrd.imginst.stage2=hd:/dev/sdb4quiet修改后......
  • npm ERR! request to https://registry.npm.taobao.org/vue-router failed, reason: c
    npminstall报错了!看提示是证书到期,究其原因是淘宝镜像的地址换了。旧:https://registry.npm.taobao.org/新:https://registry.npmmirror.com/#清除缓存npmcacheclean--force#验证缓存是否清除干净npmverifycache#更改淘宝镜像npmconfigsetregistryhttps://r......
  • 解决kali上安装wine32报错
    1.问题描述:解决kali上安装wine32报错,报错信息如下Thefollowingpackageshaveunmetdependencies:libglib2.0-0:i386:Depends:libpcre2-8-0:i386(>=10.22)butitisnotgoingtobeinstalledlibselinux1:i386:Depends:libpcre2-8-0:i386(>=10.22)butitisnot......
  • npm
    1.包安装安装项目依赖:在项目目录中使用npminstall(或简写npmi)命令可以安装package.json文件中列出的所有依赖。全局安装包:使用npminstall-g<包名>可以全局安装一个包,这样就可以在任何地方使用它。2.管理项目依赖添加依赖:npminstall<包名>--save用于生产环境依赖,np......
  • 浙江中控 inplantscada 安装 demo运行报错
    1、卸载inplantscada和杀毒软件。重新安装inplantscada(成功跑起来)。安装虚拟机win7跑不起来。2、还原官网下载的电气demo程序。 成功截图:    没有重装inplantscada和卸载杀毒软件,运行demo报错截图:  备注:建index页面。管理员方式运行,也解决不了,只有重新安装i......
  • Python报错symbol lookup error: xxx.so: undefined symbol: cufftxxx解决办法
    技术背景在上一篇文章中介绍过如何实现本地MindSpore的CUDA算子,那么在算子编译和使用的过程中可能会出现一些小问题,这里介绍的是编译成功为so动态链接库之后,在python中调用,提示找不到xxx函数/字符的报错。这里使用的编译指令为:$nvcc--shared-Xcompiler-fPIC-oxxx.soxxx.c......
  • Linux:离线搭建vsftpd服务并记录新建用户登录报错问题(转载)
    1.检查本机是否安装过vsftpd#检查是否存在vsftpdrpm-qa|grepvsftpd2.下载离线安装包下载地址:http://rpmfind.net/linux/rpm2html/search.php?query=vsftpd(x86-64)3.开始安装vsftpd#安装vsftpdrpm-ivhvsftpd-3.0.2-21.el7.x86_64.rpm4.测试是否安装成功......
  • vue项目npm run build的时候自动更新package.json中的version
    在vue项目最外侧新增一个addVersion.js 脚本,脚本中编写逻辑来解析当前的版本号//addVersion.jsconstfs=require('fs');constpath=require('path');constpackageJsonPath=path.join(__dirname,'package.json');try{//读取package.json......
  • yum nginx报错
    [root@instance-as0nsoaxnginx]#yum-yinstallgdgd-develerror:db5error(11)fromdbenv->open:Resourcetemporarilyunavailableerror:cannotopenPackagesindexusingdb5-Resourcetemporarilyunavailable(11)error:cannotopenPackagesdatabasein......
  • vscode报错,nodemon 在此系统上禁止运行脚本
    1.vscode报错,nodemon:因为在此系统上禁止运行脚本注意:不仅仅适用于nodemon报错,报在此系统上禁止运行脚本的错都可以用以下方法解决2.报错原因分析:windows为了安全,默认的执行策略为Restricted,因此需要将执行策略设置为RemoteSigned即可3.解决方法  (1)get-exec......