npm certificate has expired

异常如下

SH

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

是由于 npm 证书过期导致的,通过换npm源可以解决

sh

# 腾讯源
npm config set registry http://mirrors.cloud.tencent.com/npm/

# 淘宝镜像源
npm config set registry https://registry.npmmirror.com

# 华为源
npm config set registry https://mirrors.huaweicloud.com/repository/npm/