首页 > 其他分享 >解决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-28 19:57:23浏览次数:17  
标签:npm certificate request taobao registry https 镜像 org

今天,启动一个纯前端的老项目,安装依赖时报错。

npm 错误:request to https://registry.npm.taobao.org/ failed, reason: certificate has expired

从报错信息可看出,以前经常使用的淘宝镜像https://registry.npm.taobao.org/的证书过期了,就是该域名的备案证书过期了,但似乎直到2024年1月才完全失效。

既然淘宝已经换了新域名,那就将原先配置的npm镜像源更改就好了。

1.查看当前npm镜像

npm config get

2.配置新的镜像

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

3.再次查看镜像配置情况

npm config get

我更换后依然报错,然后发现是package-lock.json内锁定的还是旧的镜像源。

于是我将package-lock.json的https://registry.npm.taobao.org替换为https://registry.npmmirror.com,即可安装依赖成功。

 

ps:我在运行项目时报错

digital envelope routines::unsupported

是因为当前电脑node版本过高,解决方法为:

打开IDEA 终端,直接输入

$env:NODE_OPTIONS="--openssl-legacy-provider"

重新运行项目即可。

 

标签:npm,certificate,request,taobao,registry,https,镜像,org
From: https://www.cnblogs.com/luoyihao/p/18041616

相关文章

  • 解决HttpServletRequest调用getInputStream()方法读取参数只能获取一次问题
    1、问题描述由于后端接口获取前端传过的参数是通过HttpServletRequest接收获取的。现有一需求需要在接口调用之前拦截接口进行业务处理。在拦截类中调用getInputStream()获取参数之后,在接口方法里获取参数为空。2、解决方法自定义一个过滤器过滤所有请求,使用HttpServletRequest......
  • cURL error 60: SSL certificate problem: unable to get local issuer certifica 解
    cURLerror60:SSLcertificateproblem:unabletogetlocalissuercertifica解决 无法获取本地颁发者证书 Windows版本1.到https://curl.haxx.se/ca/cacert.pem下载证书文件cacert.pem,将其保存到PHP安装路径下。2.编辑php.ini文件,删除curl.cainfo配置项前......
  • 4-request对象
    前端提交数据必备知识点前端form表单中action属性,不写默认是当前路由地址前端form表单中的method属性,不写默认是GET请求前端页面templates\register.html<!DOCTYPEhtml><htmllang="en"><head><metacharset="UTF-8"><title>注册页面</title>......
  • = Request processing failed; nested exception is com.example.exceptio
    =Requestprocessingfailed;nestedexceptioniscom.example.exceptio关于映射文件的问题下次再介绍,这次主要总结hibernate常用主键生成策略。(1)incrementa)对主键值采取自动顺序增长的方式生成新的主键,值默认从1开始。b)原理:在当前应用实例中维持一个变量,以保存当前最......
  • npm安装插件,安装好时,进度条卡住解决方法
     宋田田已于2023-09-0418:19:28修改阅读量1.6k收藏24点赞数13文章标签:vuenpm版权一、遇到问题在使用npm安装插件或依赖包的时候,安装好时,进度条卡住,等待2分钟后,进度条才消失1.以npm安装vue2为例安装好时,进度条卡住文件其实已经创建好了等待2分钟后,进度条才消失2......
  • npm报错:request to https://registry.npm.taobao.org failed, reason certificate has
    一、报错问题:提示淘宝镜像过期二、错误提示已经告诉原因是淘宝镜像过期了!其实,早在2021年,淘宝就发文称,npm淘宝镜像已经从registry.npm.taobao.org切换到了registry.npmmirror.com。旧域名也将于2022年5月31日停止服务(不过,直到今天HTTPS证书到期才真正不能用了)三......
  • 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......
  • Jenkins 远程触发 403 No valid crumb was included in the request
    Jenkins使用curl执行远程触发命令,会报403错误打开如下图  系统管理-》scriptConsole在下面脚本命令行中输入hudson.security.csrf.GlobalCrumbIssuerConfiguration.DISABLE_CSRF_PROTECTION=true  查看-》系统管理-》全局安全配置 最后,请求成功 翻译搜......
  • npm
    1.包安装安装项目依赖:在项目目录中使用npminstall(或简写npmi)命令可以安装package.json文件中列出的所有依赖。全局安装包:使用npminstall-g<包名>可以全局安装一个包,这样就可以在任何地方使用它。2.管理项目依赖添加依赖:npminstall<包名>--save用于生产环境依赖,np......
  • 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......