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

request,to,https,registry,npm,taobao,org,cnpm,failed,reason,certificate,has,expired · 浏览次数 : 0

小编点评

Sure, here's the summary you requested: **Problem:** * When installing packages using `cnpm`, you might encounter an error stating that the certificate on the registry has expired. **Solution:** * Update your Node.js version to 14.18.0 or higher. This is because `cnpm` requires Node.js version 14.18.0 or higher to function properly. **Additional Notes:** * You can also try clearing your npm cache and global dependencies with `npm cache clean -f`. * If you're using a custom version of Node.js, ensure it meets the requirements. * You can refer to the logs for more detailed information.

正文

换华为的,否则会出问题:cnpm confg set registry https://mirrors.huaweicloud.com/repository/npm/

npm ERR! code CERT_HAS_EXPIRED
npm ERR! errno CERT_HAS_EXPIRED
npm ERR! request to https://registry.npm.taobao.org/cnpm failed, reason: certificate has expired

npm ERR! A complete log of this run can be found in:
npm ERR!     D:\Users\cj218\AppData\Roaming\npm-cache\_logs\2024-05-29T07_39_17_248Z-debug.log

image

更新地址

npm install -g cnpm --registry=https://registry.npmmirror.com

注意点:cnpm 要求的 nodejs 最低版本为 14.18.0
image

Nodejs 升级

下载:https://nodejs.org/en/download/prebuilt-installer
卸载已安装的版本,再安装新版本

下面命令网上找的,不可行,因为在执行的时候,它需要源,但源过期了需要升级,升级需要 Nodejs 高版本。所以死循环

# 查看当前node版本
$ node -v

# 清除npm缓存
$ npm cache clean -f

# 全局安装n
$ npm install -g n

# 升级到最新稳定版
$ n stable

# 升级到最新版
$ n latest

# 升级到定制版
$ n v14.6.0

# 切换使用版本
$ n 13.10.0 (ENTER)

# 删除制定版本
$ n rm 13.10.0

# 用制定的版本执行脚本
$ n use 13.10.0 some.js

# 升级完成查看 node版本
$ node -v

源替换成功
image
但又报错了

- [npminstall:get] retry GET https://r.npm.taobao.org/driver.js after 100ms, retry left 4, error: Error: certificate has expired
    at TLSSocket.onConnectSecure (node:_tls_wrap:1674:34)
    at TLSSocket.emit (node:events:519:28)
    at TLSSocket._finishInit (node:_tls_wrap:1085:8)
    at ssl.onhandshakedone (node:_tls_wrap:871:12) {
  code: 'CERT_HAS_EXPIRED',
  name: 'ResponseError',
  data: undefined,
  path: '/driver.js',
  status: -1,
  headers: {},
  res: [Object]
}, status: -1, headers: {},
stack: Error: certificate has expired
    at TLSSocket.onConnectSecure (node:_tls_wrap:1674:34)
    at TLSSocket.emit (node:events:519:28)
    at TLSSocket._finishInit (node:_tls_wrap:1085:8)
    at ssl.onhandshakedone (node:_tls_wrap:871:12)
[npminstall:get] retry GET https://r.npm.taobao.org/echarts after 100ms, retry left 4, error: Error: certificate has expired
    at TLSSocket.onConnectSecure (node:_tls_wrap:1674:34)
    at TLSSocket.emit (node:events:519:28)

image

换华为的。
cnpm confg set registry https://mirrors.huaweicloud.com/repository/npm/

image

与request to https://registry.npm.taobao.org/cnpm failed, reason: certificate has expired相似的内容:

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

换华为的,否则会出问题:cnpm confg set registry https://mirrors.huaweicloud.com/repository/npm/ npm ERR! code CERT_HAS_EXPIRED npm ERR! errno CERT_HAS_EXPIRED npm

[转帖]redis集群报错CROSSSLOT Keys in request don‘t hash to the same slot

先上结果: $redis->sDiffStore('live_room:robots:data:' . $info['id'], 'user_info:robots_list', ''); 上述代码执行后redis抛出一个异常。来看redis源码是如何抛出这个异常的(附redis源码地址:redis

[转帖]ERROR 2068 (HY000): LOAD DATA LOCAL INFILE file request rejected due to restrictions on access.

1.报错信息 ERROR 2068 (HY000): LOAD DATA LOCAL INFILE file request rejected due to restrictions on access. 1 2.解决方法 2.1 方法一 查询是否启动local_infile,查询命令如下: sho

【Azure 应用服务】在创建App Service时,遇见“No available instances to satisfy this request. App Service is attempting to increase capacity.”错误

"Code": "Conflict","Message": "No available instances to satisfy this request. App Service is attempting to increase capacity. Please retry your request later. If urgent, this can be mitigated by deploying this to a new resource group."

【Azure K8S | AKS】在中国区AKS上遇见ImagePullBackOff时的替代方案

Failed to pull image "k8s.gcr.io/cluster-proportional-autoscaler-amd64:1.1.2-r2": rpc error: code = Unknown desc = Error response from daemon: Get https://k8s.gcr.io/v2/: net/http: request canceled wh

[转帖]Java IO篇:什么是 Reactor 网络模型?

一、什么是 Reactor 模型: The reactor design pattern is an event handling pattern for handling service requests delivered concurrently to a service handler by

[转帖]Java IO篇:什么是 Reactor 网络模型?

一、什么是 Reactor 模型: The reactor design pattern is an event handling pattern for handling service requests delivered concurrently to a service handler by

keycloak~正确让api接口支持跨域

相关参考 https://leejjon.medium.com/how-to-allow-cross-origin-requests-in-a-jax-rs-microservice-d2a6aa2df484 https://stackoverflow.com/questions/28065963/

python并发执行request请求

本文详细介绍了Python并发执行Request请求的方法示例,给出了详细的代码示例,同时也介绍了Python中实现并发编程的方法。

SpringBoot 过滤器更改 Request body ,并实现数据解密

客户端、服务端网络通信,为了安全,会对报文数据进行加解密操作。 在SpringBoot项目中,最好使用参考AOP思想,加解密与Controller业务逻辑解耦,互不影响。 以解密为例:需要在request请求到达Controller之前进行拦截,获取请求body中的密文并对其进行解密,然后把解密后的