npm 淘宝镜像原网址:https://registry.npm.taobao.org/
npm 淘宝镜像更新后网址:https://registry.npmmirror.com
过程:
部署 nuxt docker 容器的时候,报以下错:
bash
npm ERR! code CERT_HAS_EXPIRED
npm ERR! errno CERT_HAS_EXPIRED
npm ERR! request to https://registry.npm.taobao.org/@babel%2fplugin-transform-member-expression-literals failed, reason: certificate has expired
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2024-01-31T15_36_47_852Z-debug.log
The command '/bin/sh -c npm install' returned a non-zero code: 1
网搜一番,得知:
2024年 1 月 22 日,淘宝原镜像域名(registry.npm.taobao.org)的 HTTPS 证书正式到期。如果想要继续使用,需要将 npm 源切换到新的源(registry.npmmirror.com),否则会报错。
切换 淘宝原镜像域名 后再部署,部署成功。
bash
Successfully built 19d8d23aa563
Successfully tagged jili20nuxt:latest